.grammar-hero {
  padding-bottom: 24px;
}

.grammar-quote {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  padding: 16px 22px;
  border-left: 3px solid #2ee878;
  border-radius: 0 16px 16px 0;
  background: linear-gradient(90deg, rgba(46, 232, 120, 0.08) 0%, rgba(15, 23, 42, 0.4) 100%);
  color: #e2e8f0;
  font-style: italic;
  font-size: 0.95rem;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.grammar-quote-author {
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.03em;
}

.grammar-hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.grammar-hero-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 18px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06), 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.grammar-hero-metrics span:hover {
  transform: translateY(-2px);
  border-color: rgba(46, 232, 120, 0.4);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(46, 232, 120, 0.2);
}

.grammar-hero-metrics span i {
  color: #38bdf8;
  font-size: 1.05rem;
}

.grammar-hero-metrics strong {
  color: #2ee878;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.grammar-learning-shell {
  padding-top: 18px;
}

.grammar-progress-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 22px;
  background:
    radial-gradient(circle at top left, rgba(46, 232, 120, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.96));
}

.grammar-progress-hero > div:first-child {
  display: grid;
  align-content: center;
  gap: 8px;
}

.grammar-progress-hero strong[data-grammar-progress-score] {
  color: #ffffff;
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 0.95;
}

.grammar-progress-hero p {
  margin: 0;
  color: #cbd5e1;
}

.grammar-progress-metrics {
  display: grid;
  gap: 12px;
}

.grammar-progress-metrics > span {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.44);
  color: #9be8ff;
  font-weight: 800;
  padding: 14px;
}

.grammar-progress-metrics strong {
  color: #ffffff;
  font-size: 1.65rem;
}

.grammar-topic-panel {
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.70), rgba(2, 6, 23, 0.76));
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
  padding: 20px;
}

.grammar-topic-header,
.grammar-detail-head,
.grammar-detail-meta,
.grammar-card-stats,
.grammar-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.grammar-topic-header {
  margin-bottom: 16px;
}

.grammar-topic-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.grammar-scroll-actions {
  display: inline-flex;
  gap: 8px;
}

.grammar-scroll-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(125, 211, 252, 0.26);
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.74);
  color: #ecfeff;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.grammar-scroll-button:hover {
  transform: translateY(-2px);
  border-color: rgba(112, 245, 157, 0.58);
  box-shadow: 0 0 22px rgba(46, 232, 120, 0.18);
}

.grammar-topic-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 4px 4px 22px;
  scroll-padding: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-color: rgba(112, 245, 157, 0.78) rgba(125, 211, 252, 0.14);
  scrollbar-gutter: stable;
  scrollbar-width: auto;
}

.grammar-topic-rail::-webkit-scrollbar {
  height: 14px;
}

.grammar-topic-rail::-webkit-scrollbar-track {
  border: 1px solid rgba(125, 211, 252, 0.12);
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.14);
}

.grammar-topic-rail::-webkit-scrollbar-thumb {
  border: 3px solid rgba(2, 6, 23, 0.88);
  border-radius: 999px;
  background: linear-gradient(90deg, #2ee878, #48cfff);
}

.grammar-topic-rail::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #70f59d, #9be8ff);
}

.grammar-topic-card {
  display: grid;
  grid-template-rows: auto auto minmax(64px, 1fr) auto;
  flex: 0 0 224px;
  min-height: 218px;
  border: 1px solid rgba(125, 211, 252, 0.20);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.96));
  color: #f8fbff;
  padding: 16px;
  scroll-snap-align: start;
  text-align: left;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.grammar-topic-card:hover,
.grammar-topic-card.is-active {
  transform: translateY(-4px);
  border-color: rgba(112, 245, 157, 0.58);
  box-shadow: 0 0 0 1px rgba(46, 232, 120, 0.18), 0 22px 52px rgba(0, 0, 0, 0.42);
}

.grammar-topic-card.is-active {
  background:
    linear-gradient(145deg, rgba(20, 184, 166, 0.24), rgba(14, 165, 233, 0.16)),
    rgba(2, 6, 23, 0.96);
}

.grammar-topic-card.is-completed {
  border-color: rgba(112, 245, 157, 0.34);
  background:
    linear-gradient(145deg, rgba(22, 101, 52, 0.20), rgba(2, 6, 23, 0.96));
}

.grammar-card-index {
  color: #a7fbc0;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.grammar-topic-card h3 {
  margin: 8px 0 10px;
  color: #ffffff;
  font-size: 1.22rem;
  line-height: 1.2;
}

.grammar-topic-card p {
  margin: 0;
  color: #a6b4c9;
  line-height: 1.58;
}

.grammar-card-stats {
  align-items: flex-end;
  margin-top: 14px;
}

.grammar-card-stats span {
  color: #9be8ff;
  font-size: 0.78rem;
  font-weight: 900;
}

.grammar-card-stats i {
  color: #a7fbc0;
}

.grammar-detail-view {
  margin-top: 26px;
  border: 1px solid rgba(125, 211, 252, 0.20);
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(46, 232, 120, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.98));
  box-shadow: 0 30px 74px rgba(0, 0, 0, 0.40);
  overflow: hidden;
}

.grammar-detail-head {
  align-items: flex-start;
  border-bottom: 1px solid rgba(125, 211, 252, 0.16);
  padding: 26px;
}

.grammar-detail-head h2 {
  margin: 8px 0 10px;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
}

.grammar-detail-head p {
  max-width: 760px;
  margin: 0;
  color: #cbd5e1;
  line-height: 1.72;
}

.grammar-detail-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 18px;
}

.grammar-detail-meta span,
.grammar-theory-section li,
.grammar-example,
.grammar-mistake-list li,
.grammar-exercise {
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.04);
}

.grammar-detail-meta span {
  color: #dbeafe;
  font-weight: 800;
  padding: 8px 11px;
}

.grammar-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 0;
  align-items: stretch;
}

.grammar-theory-panel {
  padding: 26px;
}

/* Bottom Xem Danh Mục Button Footer */
.grammar-back-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.grammar-back-bottom-btn {
  min-height: 44px;
  padding: 10px 24px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(46, 232, 120, 0.15) 0%, rgba(56, 189, 248, 0.15) 100%);
  border: 1px solid rgba(46, 232, 120, 0.4);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(46, 232, 120, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.grammar-back-bottom-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(46, 232, 120, 0.25) 0%, rgba(56, 189, 248, 0.25) 100%);
  border-color: rgba(46, 232, 120, 0.6);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(46, 232, 120, 0.3);
}

/* Red Gradient Notice Pill (Hard Level Aesthetic - 2 Lines) */
.practice-notice-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14) 0%, rgba(185, 28, 28, 0.24) 100%);
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), 0 0 16px rgba(239, 68, 68, 0.2);
}

.notice-line-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f87171;
  font-size: 0.88rem;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.notice-line-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Pagination Bar Controls */
.grammar-pagination-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(125, 211, 252, 0.14);
}

.pagination-arrow {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-arrow:hover:not(:disabled) {
  background: rgba(46, 232, 120, 0.15);
  border-color: rgba(46, 232, 120, 0.4);
  color: #2ee878;
}

.pagination-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-pills {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pagination-pills::-webkit-scrollbar {
  display: none;
}

.pagination-page-pill {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pagination-page-pill span {
  font-size: 0.82rem;
  font-weight: 700;
}

.pagination-page-pill small {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 600;
}

.pagination-page-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.pagination-page-pill.is-active {
  background: linear-gradient(135deg, rgba(46, 232, 120, 0.2) 0%, rgba(56, 189, 248, 0.15) 100%);
  border-color: rgba(46, 232, 120, 0.5);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(46, 232, 120, 0.22);
}

.pagination-page-pill.is-active small {
  color: #a7fbc0;
}

.pagination-page-pill.is-done i {
  color: #2ee878;
  font-size: 0.82rem;
}

.grammar-practice-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  padding: 24px;
  border-left: 1px solid rgba(125, 211, 252, 0.16);
  background: rgba(2, 6, 23, 0.22);
}

.practice-panel-head {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.grammar-exercise-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exercise-page-pill {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.exercise-page-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.exercise-page-pill.is-active {
  background: rgba(46, 232, 120, 0.15);
  border-color: rgba(46, 232, 120, 0.4);
  color: #2ee878;
  box-shadow: 0 0 12px rgba(46, 232, 120, 0.18);
}

/* Horizontal Sub-topic Tense Selector Bar */
.grammar-subtopic-header {
  margin-bottom: 14px;
}

.grammar-subtopic-header h3 {
  margin: 0 0 6px !important;
  color: #ffffff;
  font-size: 1.25rem;
}

.grammar-subtopic-header p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

.grammar-subtopic-scroll-container {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 4px 16px 2px;
  margin-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
}

.grammar-subtopic-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.grammar-subtopic-scroll-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.grammar-subtopic-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 999px;
}

.grammar-subtopic-chip {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 48px;
  padding: 8px 18px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.grammar-subtopic-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
  color: #ffffff;
  background: rgba(15, 23, 42, 0.9);
}

.grammar-subtopic-chip.is-active {
  background: linear-gradient(135deg, rgba(46, 232, 120, 0.18) 0%, rgba(56, 189, 248, 0.12) 100%);
  border-color: rgba(46, 232, 120, 0.5);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(46, 232, 120, 0.25);
}

.grammar-subtopic-chip span {
  font-size: 0.9rem;
  font-weight: 700;
  color: inherit;
}

.grammar-subtopic-chip small {
  font-size: 0.76rem;
  color: #94a3b8;
  font-weight: 500;
}

.grammar-subtopic-chip.is-active small {
  color: #a7fbc0;
}

/* Full-Width Single Tense Card (100% Width) */
.grammar-single-tense-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.88) 0%, rgba(3, 7, 18, 0.96) 100%);
  border: 1px solid rgba(56, 189, 248, 0.22);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.08),
    0 15px 35px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-top: 12px;
  animation: tenseCardFade 0.35s ease;
}

@keyframes tenseCardFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.single-tense-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tense-number {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(46, 232, 120, 0.2) 0%, rgba(56, 189, 248, 0.2) 100%);
  border: 1px solid rgba(46, 232, 120, 0.4);
  color: #2ee878;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(46, 232, 120, 0.2);
}

.tense-titles {
  flex: 1 1 auto;
}

.tense-titles h4 {
  margin: 0;
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tense-titles p {
  margin: 2px 0 0;
  color: #38bdf8;
  font-size: 1rem;
  font-weight: 700;
}

.tense-badge-category {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 999px;
}

.single-tense-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.single-tense-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #2ee878;
  font-size: 1.05rem;
  font-weight: 700;
}

.single-tense-label i {
  font-size: 1.1rem;
}

/* Formula grid inside single tense card */
.single-tense-formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.formula-card-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(112, 245, 157, 0.2);
}

.formula-card-item .formula-type {
  font-size: 0.8rem;
  font-weight: 800;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.formula-card-item code {
  font-family: monospace;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 700;
}

/* Uses list */
.single-tense-uses-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.single-tense-uses-list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.single-tense-uses-list strong {
  color: #ffffff;
  font-size: 0.95rem;
}

.tense-example-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: #a7fbc0;
  font-size: 0.92rem;
}

.tense-example-row i {
  color: #2ee878;
  margin-top: 2px;
}

/* Signals tags */
.single-tense-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.single-tense-signals span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Pro tip box */
.pro-tip-box {
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.1) 0%, rgba(15, 23, 42, 0.4) 100%);
  border-left: 4px solid #facc15;
  color: #fef08a;
  font-size: 0.92rem;
  line-height: 1.6;
}

.pro-tip-box strong {
  color: #facc15;
}

.grammar-theory-section + .grammar-theory-section,
.grammar-example-list,
.grammar-mistake-list {
  margin-top: 22px;
}

.grammar-exercise-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(46, 232, 120, 0.6) rgba(255, 255, 255, 0.05);
}

.grammar-exercise-list::-webkit-scrollbar {
  width: 6px;
}

.grammar-exercise-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.grammar-exercise-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2ee878, #38bdf8);
  border-radius: 999px;
}

.grammar-theory-section h3,
.grammar-practice-panel h3 {
  margin: 0 0 13px;
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1.25;
}

.grammar-theory-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.grammar-theory-title-row h3 {
  margin: 0;
}

.grammar-theory-toggle {
  flex: 0 0 auto;
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  color: #9be8ff;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  padding: 8px 12px;
}

.grammar-theory-toggle:hover {
  border-color: rgba(112, 245, 157, 0.58);
  color: #ffffff;
}

.grammar-theory-panel.is-theory-hidden [data-theory-memory-content],
.grammar-theory-panel.is-theory-hidden [data-formula-memory-section],
.grammar-theory-panel.is-theory-hidden [data-grammar-extra-memory-section] {
  display: none;
}

.grammar-theory-section ul,
.grammar-mistake-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.grammar-theory-section li,
.grammar-mistake-list li {
  color: #cbd5e1;
  padding: 12px 14px;
}

.grammar-formula-list {
  display: grid;
  gap: 10px;
}

.grammar-formula-list code {
  display: block;
  border: 1px solid rgba(112, 245, 157, 0.26);
  border-radius: 14px;
  background: rgba(46, 232, 120, 0.10);
  color: #d0ffd8;
  font-size: 0.98rem;
  font-weight: 900;
  padding: 12px 14px;
  white-space: normal;
}

.grammar-tense-groups,
.grammar-tense-list {
  display: grid;
  gap: 18px;
}

.grammar-tense-group {
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.30);
  padding: 18px;
}

.grammar-tense-group h4 {
  margin: 0 0 14px;
  color: #a7fbc0;
  font-size: 1.15rem;
}

.grammar-tense-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grammar-tense-card {
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.88));
  padding: 16px;
}

.grammar-tense-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.grammar-tense-head > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(46, 232, 120, 0.16);
  color: #a7fbc0;
  font-weight: 900;
}

.grammar-tense-head h5 {
  margin: 0;
  color: #ffffff;
  font-size: 1.12rem;
}

.grammar-tense-head p {
  margin: 2px 0 0;
  color: #9be8ff;
  font-weight: 800;
}

.grammar-tense-block {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.grammar-tense-block strong {
  color: #ffffff;
}

.grammar-tense-block ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
}

.grammar-tense-block li {
  border-radius: 12px;
  padding: 9px 11px;
}

.grammar-tense-formulas {
  display: grid;
  gap: 8px;
}

.grammar-tense-formulas code {
  display: block;
  border: 1px solid rgba(112, 245, 157, 0.22);
  border-radius: 12px;
  background: rgba(46, 232, 120, 0.08);
  color: #d0ffd8;
  padding: 10px 11px;
  white-space: normal;
}

.grammar-tense-formulas span {
  color: #ffffff;
  font-weight: 900;
}

.grammar-signal-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grammar-signal-list span {
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  color: #bfdbfe;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 6px 9px;
}

.grammar-example-list {
  display: grid;
  gap: 12px;
}

.grammar-example {
  padding: 14px;
}

.grammar-example strong {
  display: block;
  color: #ffffff;
}

.grammar-example span {
  display: block;
  color: #9be8ff;
  margin-top: 5px;
}

.grammar-practice-panel > p {
  margin: 0 0 18px;
  color: #a6b4c9;
}

.grammar-exercise-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 140px);
  overflow-y: auto !important;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(46, 232, 120, 0.6) rgba(255, 255, 255, 0.05);
}

.grammar-exercise-list::-webkit-scrollbar {
  width: 6px;
}

.grammar-exercise-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.grammar-exercise-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2ee878, #38bdf8);
  border-radius: 999px;
}

.grammar-exercise {
  padding: 16px;
  border-radius: 16px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, border-color 0.3s ease, background 0.3s ease;
}

.grammar-exercise.is-moving-to-bottom {
  opacity: 0.35;
  transform: translateY(24px) scale(0.96);
}

.grammar-exercise.is-correct {
  border-color: rgba(112, 245, 157, 0.44);
  background: rgba(46, 232, 120, 0.08);
}

.grammar-check-row {
  align-items: flex-start;
  margin-bottom: 8px;
}

.grammar-check-row strong {
  color: #ffffff;
  font-size: 0.92rem;
  line-height: 1.35;
}

.grammar-check-row span {
  color: #a7fbc0;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.grammar-options {
  display: grid;
  gap: 8px;
}

.grammar-option {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.68);
  color: #dbeafe;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 14px;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.grammar-option:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.52);
}

.grammar-option.is-correct {
  border-color: rgba(112, 245, 157, 0.64);
  background: rgba(46, 232, 120, 0.16);
  color: #d0ffd8;
}

.grammar-option.is-wrong {
  border-color: rgba(248, 113, 113, 0.58);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.grammar-feedback {
  min-height: 24px;
  margin: 11px 0 0;
  color: #9be8ff;
  font-weight: 800;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .grammar-progress-hero {
    grid-template-columns: 1fr;
  }

  .grammar-detail-grid,
  .grammar-tense-list {
    grid-template-columns: 1fr;
  }

  .grammar-practice-panel {
    position: static;
    max-height: none;
    overflow: visible;
    border-left: 0;
    border-top: 1px solid rgba(125, 211, 252, 0.16);
  }
}

@media (max-width: 680px) {
  .grammar-topic-header,
  .grammar-detail-head,
  .grammar-check-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .grammar-scroll-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .grammar-scroll-button {
    width: 100%;
    border-radius: 14px;
  }

  .grammar-topic-panel,
  .grammar-detail-head,
  .grammar-theory-panel,
  .grammar-practice-panel {
    border-radius: 18px;
    padding: 18px;
  }

  .grammar-topic-card {
    flex-basis: min(82vw, 250px);
  }
}
