.cbpt-ielts-modal[hidden],
.cbpt-ielts-app[hidden] {
  display: none !important;
}

.cbpt-ielts-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(27, 38, 85, 0.45);
  backdrop-filter: blur(8px);
}

.cbpt-ielts-modal-card {
  position: relative;
  width: min(100%, 760px);
  padding: 40px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(27, 38, 85, 0.22);
}

.cbpt-ielts-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  border: 0;
  background: transparent;
  color: #8a8475;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.cbpt-ielts-lock {
  margin-bottom: 14px;
  text-align: center;
  font-size: 42px;
}

.cbpt-ielts-modal-card h3 {
  margin: 0 0 10px;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 42px;
  font-weight: 500;
  color: #1b2655;
}

.cbpt-ielts-modal-card > p {
  max-width: 480px;
  margin: 0 auto 24px;
  text-align: center;
  font-size: 15px;
  line-height: 1.65;
  color: #8a8475;
}

.cbpt-ielts-modal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}

.cbpt-ielts-modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cbpt-ielts-modal-form label span {
  font-size: 13px;
  font-weight: 600;
  color: #8a8475;
}

.cbpt-ielts-modal-form input {
  height: 52px;
  border: 1.5px solid #ddd8d0;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 16px;
}

.cbpt-ielts-modal-form input:focus {
  outline: 0;
  border-color: rgba(27, 38, 85, 0.4);
  box-shadow: 0 0 0 4px rgba(27, 38, 85, 0.07);
}

.cbpt-ielts-modal-submit,
.cbpt-ielts-modal-status {
  grid-column: 1 / -1;
}

.cbpt-ielts-modal-submit {
  height: 56px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: #b8292d;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.cbpt-ielts-modal-status {
  min-height: 20px;
  margin: 0;
  font-size: 14px;
  color: #1b2655;
}

.cbpt-ielts-modal-status.is-error {
  color: #b8292d;
}

.cbpt-ielts-app {
  position: fixed;
  inset: 0;
  z-index: 2300;
  background: #f8f5f0;
}

body.admin-bar .cbpt-ielts-app {
  inset: 32px 0 0;
}

.cbpt-ielts-shell {
  height: 100%;
  font-family: "DM Sans", sans-serif;
  color: #2d2d2d;
}

.cbpt-ielts-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.cbpt-ielts-screen[hidden] {
  display: none !important;
}

.cbpt-ielts-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 54px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid #ddd8d0;
  box-shadow: 0 1px 4px rgba(27, 38, 85, 0.06);
}

.cbpt-ielts-left,
.cbpt-ielts-right {
  display: flex;
  align-items: center;
}

.cbpt-ielts-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1;
}

.cbpt-ielts-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1b2655;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.cbpt-ielts-logo img {
  width: auto;
  height: 30px;
  object-fit: contain;
}

.cbpt-ielts-logo b {
  color: #b8292d;
}

.cbpt-ielts-sep {
  width: 1px;
  height: 18px;
  margin: 0 12px;
  background: #ddd8d0;
}

.cbpt-ielts-test-name {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #8a8475;
}

.cbpt-ielts-badge {
  border: 1px solid rgba(27, 38, 85, 0.22);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1b2655;
  background: rgba(27, 38, 85, 0.04);
}

.cbpt-ielts-right {
  gap: 8px;
}

.cbpt-ielts-timer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 96px;
  justify-content: center;
  padding: 6px 14px;
  border: 1.5px solid #ddd8d0;
  border-radius: 8px;
  background: #f8f5f0;
  color: #1b2655;
  font-family: "DM Mono", monospace;
  font-size: 16px;
  font-weight: 500;
}

.cbpt-ielts-timer svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.cbpt-ielts-timer.is-urgent {
  color: #b8292d;
  border-color: rgba(184, 41, 45, 0.45);
  background: #fff5f5;
}

.cbpt-ielts-pbar {
  height: 2px;
  background: #e8e4de;
}

.cbpt-ielts-pfill {
  height: 100%;
  width: 0;
  background: #b8292d;
  transition: width 0.2s ease;
}

.cbpt-ielts-fullpage {
  flex: 1;
  overflow-y: auto;
  padding: 36px 48px;
  background: #f8f5f0;
}

.cbpt-ielts-container {
  max-width: 820px;
  margin: 0 auto;
}

.cbpt-ielts-listening-wrap {
  max-width: 720px;
}

.cbpt-ielts-kicker {
  margin-bottom: 6px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a8475;
}

.cbpt-ielts-screen-title,
.cbpt-ielts-review-head h2,
.cbpt-ielts-done-card h2,
.cbpt-ielts-writing-title {
  margin: 0 0 4px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 54px;
  font-weight: 400;
  line-height: 0.95;
  color: #1b2655;
}

.cbpt-ielts-subtitle,
.cbpt-ielts-review-head p,
.cbpt-ielts-done-card p,
.cbpt-ielts-writing-copy {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.65;
  color: #8a8475;
}

.cbpt-ielts-passage {
  margin-bottom: 20px;
  padding: 16px 20px;
  border-left: 3px solid #ddd8d0;
  border-radius: 0 8px 8px 0;
  background: #f4f1ec;
  white-space: pre-line;
  font-size: 14.5px;
  line-height: 1.9;
}

.cbpt-ielts-card,
.cbpt-ielts-done-card {
  margin-bottom: 20px;
  padding: 28px 32px;
  border: 1px solid #ddd8d0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 8px rgba(27, 38, 85, 0.05);
}

.cbpt-ielts-card-title {
  margin-bottom: 12px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  color: #1b2655;
}

.cbpt-ielts-muted {
  margin: 0 0 12px;
  font-size: 13px;
  color: #8a8475;
}

.cbpt-ielts-audio {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 22px;
  border-radius: 12px;
  background: #1b2655;
}

.cbpt-ielts-audio-play {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #b8292d;
  cursor: pointer;
}

.cbpt-ielts-audio-play svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.cbpt-ielts-audio-copy {
  flex: 1;
}

.cbpt-ielts-audio-label {
  margin-bottom: 4px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.cbpt-ielts-audio-title {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.cbpt-ielts-audio-track {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.cbpt-ielts-audio-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: #b8292d;
}

.cbpt-ielts-audio-time {
  color: rgba(255, 255, 255, 0.45);
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.cbpt-ielts-listening-title {
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid #1b2655;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  color: #1b2655;
}

.cbpt-ielts-listening-note {
  margin-bottom: 18px;
  color: #b8292d;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cbpt-ielts-listening-group h4 {
  margin: 18px 0 14px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #f0f0f8;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  color: #1b2655;
}

.cbpt-ielts-listening-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 14px;
}

.cbpt-ielts-listening-row strong {
  min-width: 28px;
}

.cbpt-ielts-listening-input {
  border: 0;
  border-bottom: 2px solid #1b2655;
  background: transparent;
  padding: 4px 8px;
  font-size: 14px;
  font-family: inherit;
  color: #2d2d2d;
  outline: none;
}

.cbpt-ielts-listening-input.wide {
  flex: 1;
  min-width: 180px;
}

.cbpt-ielts-option-card,
.cbpt-ielts-writing-task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1.5px solid #ddd8d0;
  border-radius: 10px;
  background: #f8f5f0;
  cursor: pointer;
  transition: all 0.16s ease;
}

.cbpt-ielts-option-card:hover,
.cbpt-ielts-writing-task:hover {
  border-color: rgba(27, 38, 85, 0.3);
  background: #f4f1ec;
}

.cbpt-ielts-option-card.is-selected,
.cbpt-ielts-writing-task.is-selected {
  border-color: rgba(184, 41, 45, 0.45);
  background: #fdf2f2;
}

.cbpt-ielts-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.cbpt-ielts-option-key,
.cbpt-ielts-writing-task-key {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd8d0;
  border-radius: 7px;
  background: #fff;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: #8a8475;
  flex: 0 0 auto;
}

.cbpt-ielts-option-card.is-selected .cbpt-ielts-option-key,
.cbpt-ielts-writing-task.is-selected .cbpt-ielts-writing-task-key {
  border-color: #b8292d;
  background: #b8292d;
  color: #fff;
}

.cbpt-ielts-option-text,
.cbpt-ielts-writing-task-body {
  font-size: 14px;
  line-height: 1.65;
  color: #2d2d2d;
}

.cbpt-ielts-option-card.is-selected .cbpt-ielts-option-text,
.cbpt-ielts-writing-task.is-selected .cbpt-ielts-writing-task-body {
  color: #1b2655;
  font-weight: 500;
}

.cbpt-ielts-tfng {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.cbpt-ielts-tfng button {
  flex: 1;
  padding: 9px 4px;
  border: 1.5px solid #ddd8d0;
  border-radius: 8px;
  background: #f8f5f0;
  color: #8a8475;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.cbpt-ielts-tfng button.is-selected-true {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #2e7d32;
}

.cbpt-ielts-tfng button.is-selected-false {
  background: #fce4ec;
  border-color: #e57373;
  color: #c62828;
}

.cbpt-ielts-tfng button.is-selected-notgiven {
  background: #e3f2fd;
  border-color: #64b5f6;
  color: #1565c0;
}

.cbpt-ielts-writing-textarea {
  width: 100%;
  min-height: 240px;
  margin-top: 14px;
  padding: 16px;
  border: 1.5px solid #ddd8d0;
  border-radius: 10px;
  font-size: 14.5px;
  line-height: 1.85;
  resize: vertical;
  outline: none;
}

.cbpt-ielts-writing-textarea:focus {
  border-color: rgba(27, 38, 85, 0.45);
  box-shadow: 0 0 0 4px rgba(27, 38, 85, 0.07);
}

.cbpt-ielts-writing-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 13px;
  color: #8a8475;
}

.cbpt-ielts-writing-status,
.cbpt-ielts-submit-status {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 14px;
  color: #8a8475;
}

.cbpt-ielts-writing-status.is-error,
.cbpt-ielts-submit-status.is-error {
  color: #b8292d;
}

.cbpt-ielts-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid #e8e4de;
}

.cbpt-ielts-nbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 18px;
  border: 1.5px solid #ddd8d0;
  border-radius: 8px;
  background: #fff;
  color: #8a8475;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.cbpt-ielts-nbtn-pri {
  border-color: #b8292d;
  background: #b8292d;
  color: #fff;
}

.cbpt-ielts-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ddd8d0;
}

.cbpt-ielts-dot.is-answered {
  background: rgba(27, 38, 85, 0.28);
}

.cbpt-ielts-dot.is-current {
  background: #b8292d;
  transform: scale(1.4);
}

.cbpt-ielts-speaking-block {
  padding: 16px 0;
  border-bottom: 1px solid #e8e4de;
}

.cbpt-ielts-speaking-block:last-child {
  border-bottom: 0;
}

.cbpt-ielts-speaking-block h4 {
  margin: 0 0 10px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  color: #1b2655;
}

.cbpt-ielts-speaking-block ul {
  margin: 0;
  padding-left: 20px;
  color: #2d2d2d;
}

.cbpt-ielts-speaking-block li + li {
  margin-top: 8px;
}

.cbpt-ielts-review-head {
  margin-bottom: 20px;
}

.cbpt-ielts-review-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #ddd8d0;
  border-radius: 12px;
  overflow: hidden;
}

.cbpt-ielts-review-stats > div {
  padding: 12px 14px;
  border-right: 1px solid #ddd8d0;
}

.cbpt-ielts-review-stats > div:last-child {
  border-right: 0;
}

.cbpt-ielts-review-stats span,
.cbpt-ielts-review-summary dt,
.cbpt-ielts-done-grid span {
  display: block;
  margin-bottom: 4px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(27, 38, 85, 0.5);
}

.cbpt-ielts-review-stats strong,
.cbpt-ielts-review-summary dd,
.cbpt-ielts-done-grid strong {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1b2655;
}

.cbpt-ielts-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 24px;
  margin-top: 18px;
}

.cbpt-ielts-review-panel {
  padding: 18px;
  border: 1px solid #ddd8d0;
  border-radius: 12px;
  background: #f8f5f0;
}

.cbpt-ielts-review-panel-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #1b2655;
}

.cbpt-ielts-review-preview {
  max-height: 180px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.75;
}

.cbpt-ielts-review-summary {
  display: grid;
  gap: 16px;
}

.cbpt-ielts-review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #ddd8d0;
  border-radius: 12px;
  background: #f8f5f0;
}

.cbpt-ielts-review-note {
  max-width: 620px;
  font-size: 13px;
  line-height: 1.6;
  color: #8a8475;
}

.cbpt-ielts-review-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.cbpt-ielts-done-card {
  max-width: 1120px;
  margin: 40px auto 0;
}

.cbpt-ielts-done-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 26px 0;
}

.cbpt-ielts-done-steps {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.cbpt-ielts-done-steps > div {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: #2d2d2d;
}

.cbpt-ielts-done-steps strong {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #1b2655;
  color: #fff;
}

@media (max-width: 1024px) {
  .cbpt-ielts-fullpage {
    padding: 28px 24px;
  }

  .cbpt-ielts-review-grid,
  .cbpt-ielts-review-stats,
  .cbpt-ielts-done-grid {
    grid-template-columns: 1fr;
  }

  .cbpt-ielts-review-actions,
  .cbpt-ielts-writing-meta,
  .cbpt-ielts-nav-row,
  .cbpt-ielts-hdr {
    flex-direction: column;
    align-items: stretch;
  }

  .cbpt-ielts-mid {
    order: 3;
  }
}

@media (max-width: 640px) {
  .cbpt-ielts-modal-card {
    padding: 32px 20px 24px;
  }

  .cbpt-ielts-modal-form {
    grid-template-columns: 1fr;
  }

  .cbpt-ielts-screen-title,
  .cbpt-ielts-review-head h2,
  .cbpt-ielts-done-card h2,
  .cbpt-ielts-writing-title {
    font-size: 40px;
  }

  .cbpt-ielts-card,
  .cbpt-ielts-done-card {
    padding: 22px 18px;
  }
}
