.sentences-toolbar {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  align-items: end;
  grid-template-columns: minmax(220px, 260px) auto;
}

.sentences-level-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 260px;
}

.sentences-field-label {
  font-weight: 700;
  color: var(--text);
}

.sentences-select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  outline: none;
}

.sentences-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

.sentences-level-summary {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 14px;
}

.sentences-placement-card {
  margin-top: 16px;
}

.placement-result {
  margin-top: 18px;
}

.placement-modal[hidden] {
  display: none !important;
}

.placement-modal {
  position: fixed;
  inset: 0;
  z-index: 1600;
}

.placement-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(4px);
}

.placement-modal-dialog {
  position: relative;
  z-index: 1;
  max-width: min(1100px, calc(100vw - 28px));
  max-height: min(86vh, 920px);
  margin: 5vh auto 0;
  padding: 24px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.placement-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.placement-modal-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.placement-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.placement-modal-actions {
  margin-top: 18px;
}

.sentences-list {
  display: grid;
  gap: 16px;
}

#sentences-list + .botones {
  margin-top: 22px;
}

.sentence-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}

.sentence-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.sentence-card-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
}

.sentence-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sentence-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.sentence-text {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
  word-break: break-word;
}

.sentence-inline-input {
  display: inline-block;
  vertical-align: middle;
  min-width: 90px;
  margin: 0 4px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 2px solid rgba(203, 213, 225, 0.22);
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  font: inherit;
  text-align: center;
  outline: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.sentence-inline-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
}

.sentence-inline-input.correct {
  border-color: var(--success);
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}

.sentence-inline-input.incorrect {
  border-color: var(--danger);
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
  cursor: pointer;
}

.sentence-inline-input.show-answer {
  border-color: var(--info);
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  cursor: pointer;
}

.sentence-inline-input.correct,
.sentence-inline-input.incorrect,
.sentence-inline-input.show-answer {
  animation: sentencePop 0.18s ease;
}

@keyframes sentencePop {
  0% {
    transform: scale(0.98);
  }
  100% {
    transform: scale(1);
  }
}

.sentences-actions {
  margin-top: 18px;
}

.sentence-empty {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  color: var(--muted);
  text-align: center;
}

.placement-good {
  color: var(--success);
}

.placement-mid {
  color: #f59e0b;
}

.placement-high {
  color: var(--accent);
}

@media (max-width: 720px) {
  .sentences-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .sentence-card {
    padding: 16px;
  }

  .sentence-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .sentence-text {
    font-size: 0.98rem;
    line-height: 1.7;
  }

  .sentence-inline-input {
    min-width: 76px;
    padding: 8px 8px;
    font-size: 0.95rem;
  }

  .sentences-level-select-wrap {
    max-width: none;
  }

  .placement-modal-dialog {
    margin: 3vh 12px 0;
    padding: 18px;
  }

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