.clp-practice-shortcut-hint {
  margin-top: 10px;
	margin-bottom:20px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  color: #4b5563;
  text-align: center;
}


.clp-wrapper {
  width: 100%;
  margin: 24px auto;
}

.clp-card {
  max-width: 920px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.clp-step-title {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  color: #00bd15;
}

.clp-title {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.3;
  font-weight: 700;
  color: #111827;
}


.clp-input-section,
.clp-editor-section,
.clp-practice-section,
.clp-summary-section {
  margin-top: 24px;
}

.clp-input-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #111827;
}

#clp-source-text,
#clp-level,
.clp-chunk-textarea,
.clp-answer-input {
  width: 100%;
height:50px;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.6;
  background: #fff;
  color: #111827;
}

#clp-source-text {
  min-height: 350px;
  resize: vertical;
  margin-bottom: 16px;
}

#clp-level {
  margin-bottom: 16px;
  background: #fff;
}

.clp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clp-btn:hover {
  transform: translateY(-1px);
}

.clp-btn-primary {
  background: #00bd15;
  color: #fff;
}



.clp-btn-secondary {
  background: white;
	border:1px solid #4CAF50;
  color: black;
}

.clp-btn-secondary:hover {
  background: #00bd15;
}

.clp-btn-danger {
  background: #fef2f2;
  color: #b91c1c;
}

.clp-btn-danger:hover {
  background: #fee2e2;
}

.clp-editor-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.clp-editor-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #00bd15;
}

.clp-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.clp-chunk-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.clp-chunk-item {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #fafafa;
}

.clp-chunk-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.clp-chunk-meta {
  font-size: 16px;
  color: #4b5563;
  font-weight: 600;
}

.clp-chunk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clp-chunk-textarea {
  min-height: 72px;
  resize: vertical;
  background: #fff;
}

.clp-empty-box,
.clp-message-box {
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 14px;
  padding: 16px;
  color: #475569;
  font-size: 16px;
}

.clp-helper-text {
  margin-top: 8px;
  font-size: 16px;
  color: #6b7280;
}

.clp-hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .clp-card {
    padding: 16px;
    border-radius: 14px;
  }

  .clp-title {
    font-size: 24px;
  }

  .clp-editor-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .clp-chunk-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .clp-btn {
    width: 100%;
  }

  .clp-editor-actions,
  .clp-chunk-actions {
    width: 100%;
  }

  .clp-editor-actions .clp-btn,
  .clp-chunk-actions .clp-btn {
    flex: 1 1 100%;
  }
}


.clp-level-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.clp-level-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clp-level-btn:hover{
	background:white}

.clp-level-btn.is-active {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.clp-level-btn-label {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.clp-level-btn-meta {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  color: #6b7280;
}

.clp-chunk-panel {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fafafa;
  padding: 16px;

  max-height: 420px;   /* chiều cao tối đa */
  overflow-y: auto;    /* auto scroll khi dài */
}

.clp-chunk-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.clp-chunk-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.clp-chunk-panel-subtitle {
  font-size: 15px;
  color: #6b7280;
}

.clp-compact-chunk-list {
  gap: 2px;
}

.clp-chunk-row {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}

.clp-chunk-row-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.clp-chunk-number {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #15803d;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clp-chunk-content {
  flex: 1;
  min-width: 0;
}

.clp-chunk-text {
  font-size: 16px;
  line-height: 1.7;
  color: #111827;
  word-break: break-word;
}

.clp-chunk-inline-editor {
  width: 100%;
  min-height: 84px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}

.clp-chunk-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}


.clp-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.clp-editor-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 768px) {
  .clp-level-switcher {
    grid-template-columns: 1fr;
  }

  .clp-chunk-row-main {
    flex-direction: column;
  }

  .clp-chunk-row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .clp-editor-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .clp-editor-footer-right {
    flex-direction: column;
    width: 100%;
  }

  .clp-editor-footer-right .clp-btn,
  #clp-back-to-step1-btn {
    width: 100%;
  }
}

.clp-chunk-row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clp-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.15s ease, color 0.2s ease;
}

.clp-action-icon:hover {
  opacity: 1;
  transform: scale(1.08);
  color: #111827;
}

.clp-action-icon svg {
  display: block;
}

/* container vùng hover */
.clp-insert-slot{
  position: relative;
  height: 14px;
}

/* full width invisible button */
.clp-insert-chunk-btn{
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);

  display: flex;
  align-items: center;
  gap: 8px;

  padding: 0;
  margin: 0;

  border: none;
  background: none !important;

  cursor: pointer;
  opacity: 0;

  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;

  transition: opacity .15s ease;
}

/* remove any browser focus styles */
.clp-insert-chunk-btn:focus,
.clp-insert-chunk-btn:active{
  outline: none;
  box-shadow: none;
  background: none;
}

/* show button when hovering slot */
.clp-insert-slot:hover .clp-insert-chunk-btn{
  opacity: 1;
}

/* horizontal line */
.clp-insert-line{
  flex: 1;
  height: 1px;
  background: #22c55e;
}

/* plus icon */
.clp-insert-plus{
  width: 20px;
  height: 20px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  border: 2px solid #22c55e;

  color: #22c55e;
  font-size: 13px;
  font-weight: 600;

  background: white;
  flex-shrink: 0;

  transition: all .15s ease;
}

/* hover animation */
.clp-insert-chunk-btn:hover .clp-insert-plus{
  background: #22c55e;
  color: white;
  transform: scale(1.05);
}

.clp-practice-section {
max-width: 920px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}


.clp-practice-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 0 20px;
}

.clp-practice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.clp-practice-title {
  margin: 8px 0 4px;
  font-size: 28px;
  font-weight: 800;
  color: #00bd15;
}

.clp-practice-subtitle {
  font-size: 16px;
  color: #3d3d3d;
}

.clp-practice-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin-bottom: 20px;
}

.clp-practice-progress-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.clp-practice-hero-box {
  min-height: 100px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  background: linear-gradient(42deg, #156c35 0%, #07b91b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 10px 24px rgba(21, 108, 53, 0.18);
}

.clp-practice-hero-box.is-excellent {
  background: linear-gradient(42deg, #14532d 0%, #16a34a 100%);
  border-color: rgba(255,255,255,0.2);
}

.clp-practice-hero-box.is-good {
  background: linear-gradient(42deg, #166534 0%, #22c55e 100%);
  border-color: rgba(255,255,255,0.18);
}

.clp-practice-hero-box.is-fair {
  background: linear-gradient(42deg, #15803d 0%, #4ade80 100%);
  border-color: rgba(255,255,255,0.18);
}

.clp-practice-hero-box.is-low {
  background: linear-gradient(42deg, #166534 0%, #86efac 100%);
  border-color: rgba(255,255,255,0.18);
}

.clp-practice-hero-instruction,
.clp-practice-hero-score {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.clp-practice-hero-icon,
.clp-practice-hero-emoji {
  font-size: 28px;
  line-height: 1;
  color: #ffffff;
}

.clp-practice-hero-text,
.clp-practice-hero-score-text {
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
}



.clp-practice-original-toggle-row {
  margin-bottom: 10px;
}

.clp-text-toggle-btn{
  background: none !important;
  border: none;
  padding: 0;
  margin: 0;
font-style: italic;
  color: #0f8b1d;
  font-size: 15px;
  font-weight: 400;

  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;

  box-shadow: none !important;
  outline: none;

  opacity: 1;
  -webkit-tap-highlight-color: transparent;
}

/* remove any hover / focus background */
.clp-text-toggle-btn:hover,
.clp-text-toggle-btn:focus,
.clp-text-toggle-btn:active{
  background: none !important;
  box-shadow: none !important;
	font-style: italic;
  color: #0f8b1d;
  outline: none;
  opacity: 1;
}

.clp-practice-original {
  border: 1px solid #dcfce7;
  background: #f0fdf4;
  color: #166534;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  line-height: 1.7;
}


.clp-practice-input-wrap {
  margin-bottom: 18px;
}

.clp-practice-input {
	height:70px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 17px;
  line-height: 1.6;
  color: #111827;
  background: #fff;
  resize: none;
}

.clp-practice-input:focus {
  outline: none;
  border-color: #d8def0;
  box-shadow: none;
}

.clp-practice-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}

.clp-practice-main-btn {
  min-width: 120px;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.clp-practice-main-btn:hover {
  transform: translateY(-1px);
}

.clp-practice-main-btn.is-play {
  background: #00bd15;
  color: #fff;
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.22);
}

.clp-practice-main-btn.is-submit {
  background: #00bd15;
  color: #fff;
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.22);
}

.clp-practice-main-btn.is-skip {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.clp-speed-select {
  width: 200px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

.clp-practice-speed-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.clp-practice-speed-wrap {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 5;
}

.clp-practice-speed-wrap label {
  display: block;
  margin-bottom: 10px;
  color: #4b5563;
  font-weight: 420;
}



@media (max-width: 768px) {
  .clp-practice-header {
    flex-direction: column;
    align-items: stretch;
  }

  .clp-practice-title {
    font-size: 24px;
  }

  .clp-practice-hero-box {
    min-height: 120px;
    padding: 18px;
  }

  .clp-practice-hero-text,
  .clp-practice-hero-score-text {
    font-size: 18px;
  }

  .clp-practice-action-row {
    flex-direction: column;
  }

  .clp-practice-main-btn {
    width: 100%;
  }

  .clp-practice-input {
    font-size: 16px;
  }
}

.clp-summary-shell {
  max-width: 980px;
  margin: 0 auto;
}

.clp-summary-header {
  margin-bottom: 18px;
}

.clp-summary-title {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}

.clp-summary-subtitle {
  font-size: 15px;
  line-height: 1.6;
  color: #64748b;
}

.clp-summary-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.clp-summary-stat-card {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.clp-summary-stat-value {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  margin-bottom: 8px;
  color: #0f172a;
}

.clp-summary-stat-value.is-excellent {
  color: #16a34a;
}

.clp-summary-stat-value.is-good {
  color: #0388dd;
}

.clp-summary-stat-value.is-fair {
  color: #ea580c;
}

.clp-summary-stat-value.is-low {
  color: #dc2626;
}

.clp-summary-stat-label {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  color: #64748b;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 0;
}

.clp-summary-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.clp-summary-extra-item {
	gap:6px;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  color: #475569;
  font-size: 14px;
  line-height: 1.4;
}

.clp-summary-focus {
  margin-bottom: 30px;
  padding: 16px;
  border-radius: 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.clp-summary-focus-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.clp-summary-focus-item {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 14px;
  font-weight: 600;
}

.clp-summary-results-title {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 800;
  color: #0f172a;
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 12px;
}

.clp-diff-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.clp-diff-legend span {
  font-size: 14px;
  font-weight: 600;
}

.clp-summary-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.clp-result-card {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.clp-result-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.clp-result-chunk-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.clp-result-left{
  display:flex;
  align-items:center;
  gap:14px;
}

.clp-result-replay {
	margin-left:auto;
  margin-right:12px;
	font-size: 15px;
}

.clp-result-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 16px;
  font-weight: 800;
  border: 1px solid #e5e7eb;
}

.clp-result-score.is-excellent {
  color: #16a34a;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.clp-result-score.is-good {
  color: #0388dd;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.clp-result-score.is-fair {
  color: #ea580c;
  background: #fff7ed;
  border-color: #fed7aa;
}

.clp-result-score.is-low {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.clp-result-row {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.8;
  color: #334155;
}

.clp-result-row strong {
  color: #0f172a;
}

.clp-summary-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.clp-summary-actions .clp-btn {
  min-width: 180px;
}


@media (max-width: 900px) {
  .clp-summary-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .clp-summary-title {
    font-size: 24px;
  }

  .clp-summary-stats {
    grid-template-columns: 1fr;
  }

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

  .clp-summary-actions {
    flex-direction: column;
  }

  .clp-summary-actions .clp-btn {
    width: 100%;
  }
}

.clp-diff-word{
  display:inline-block;
  margin:2px 4px 2px 0;
  line-height:1.6;
  font-weight:500;
}

/* đúng */
.clp-diff-word.is-correct{
  color:#16a34a;
}

/* gần đúng */
.clp-diff-word.is-near{
  color:#f59e0b;
}

/* thừa */
.clp-diff-word.is-extra{
	text-underline-offset: 4px;
	text-decoration: underline;
  color:#ef4444;
}

.clp-diff-word.is-missing {
    text-underline-offset: 4px;
    color: #64748b;
    text-decoration: underline dotted;
	opacity: 0.85; }


/* empty */
.clp-diff-empty{
  color:#9ca3af;
  font-style:italic;
}

.clp-diff-legend{
  display:flex;
  gap:18px;
  font-size:14px;
  margin-bottom:14px;
  flex-wrap:wrap;
}

.clp-diff-legend span{
  font-weight:500;
}

.clp-summary-focus-note {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #64748b;
}

.clp-summary-focus.is-positive {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.clp-summary-focus.is-positive .clp-summary-focus-note {
  color: #166534;
}