.grammar-carousel {
  margin-top: 24px;
}

.grammar-carousel__viewport {
  overflow: hidden;
  width: 100%;
  touch-action: pan-y;
}

.grammar-carousel__track {
  display: flex;
  align-items: stretch;
  transition: transform 0.28s ease;
  will-change: transform;
}

.grammar-carousel__slide {
  box-sizing: border-box;
  flex: 0 0 100%;
  max-width: 100%;
}

.grammar-carousel .grammar-card {
  box-sizing: border-box;
  margin-top: 0;
}

.grammar-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.grammar-carousel__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #475569;
  border-radius: 50%;
  background: #334155;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s ease;
}

.grammar-carousel__button:hover:not(:disabled) {
  background: #475569;
}

.grammar-carousel__button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.grammar-carousel__status {
  min-width: 72px;
  color: #cbd5e1;
  font-weight: 700;
  text-align: center;
}

.grammar-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 24px;
  margin-top: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.grammar-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.grammar-card__header h3 {
  margin: 0;
}

.grammar-card__progress {
  flex: 0 0 auto;
  border: 1px solid #475569;
  border-radius: 999px;
  padding: 4px 10px;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.grammar-card h2,
.grammar-card h3,
.grammar-card p,
.grammar-card li {
  color: #e2e8f0;
}

.question-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.question-text {
  margin: 0;
}

.question-audio-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #475569;
  border-radius: 50%;
  background: #334155;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.question-audio-button:hover {
  background: #475569;
}

.question-audio-button.is-speaking {
  border-color: #38bdf8;
  color: #7dd3fc;
}

.question-translation {
  margin-top: 8px;
  color: #cbd5e1;
  font-size: 15px;
}

.question-translation.is-revealed {
  color: #e2e8f0;
  font-weight: 700;
}

.options {
  margin-top: 16px;
}

.options button {
  padding: 10px 20px;
  margin-right: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #334155;
  color: #e2e8f0;
  transition: all 0.2s ease;
}

.options button:hover {
  background: #475569;
}

.correct {
  background: #35a05c !important;
  color: white !important;
}

.wrong {
  background: #d1b24d !important;
  color: white !important;
}

.result {
  margin-top: 16px;
  font-weight: bold;
  color: #cbd5e1;
}

.grammar-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}

.grammar-breakdown span {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: left;

  min-width: 70px;
}

.grammar-desc {
  display: none;

  position: absolute;
  left: calc(100% + 12px);
  top: 0;

  width: max-content;
  min-width: 120px;
  max-width: min(360px, calc(100vw - 48px));

  background: #1e293b;
  color: #e2e8f0;

  border: 1px solid #334155;
  border-radius: 8px;

  padding: 10px;
  z-index: 100;

  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: normal;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.grammar-breakdown span.is-desc-left .grammar-desc {
  right: calc(100% + 12px);
  left: auto;
}

.word {
  font-size: 18px;
  font-weight: 600;
  padding-bottom: 4px;
}

.kk {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.4;
}

.grammar-breakdown span:hover .grammar-desc,
.grammar-breakdown span.is-desc-open .grammar-desc {
  display: block;
}

.grammar-breakdown small {
  position: absolute;
  left: 0;
  bottom: -18px;
  font-size: 11px;
  opacity: 0.8;
}

.grammar-note {
  margin-top: 24px;
  border-left: 3px solid #38bdf8;
  padding: 10px 12px;
  background: rgba(56, 189, 248, 0.08);
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.7;
}

/* Subject */
.grammar-subject {
  color: #7dd3fc;
  border-color: #38bdf8;
}

/* Possessive Pronoun */
.grammar-possessive {
  color: #f9a8d4;
  border-color: #ec4899;
}

/* Object Pronoun */
.grammar-object {
  color: #c4b5fd;
  border-color: #8b5cf6;
}

/* Be Verb */
.grammar-beverb {
  color: #fca5a5;
  border-color: #ef4444;
}

/* Article */
.grammar-article {
  color: #fcd34d;
  border-color: #f59e0b;
}

/* Noun */
.grammar-noun {
  color: #a5b4fc;
  border-color: #6366f1;
}

/* Verb */
.grammar-verb {
  color: #fca5a5;
  border-color: #ef4444;
}

/* Adjective */
.grammar-adj {
  color: #c4b5fd;
  border-color: #8b5cf6;
}

/* Preposition */
.grammar-prep {
  color: #86efac;
  border-color: #22c55e;
}

/* Time */
.grammar-time {
  color: #fde68a;
  border-color: #f59e0b;
}

/* Place */
.grammar-place {
  color: #fdba74;
  border-color: #f97316;
}
