.cbpt-modal-open,
.cbpt-runner-open {
  overflow: hidden;
}

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

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

.cbpt-modal-open .wa-float,
.cbpt-runner-open .wa-float {
  display: none !important;
}

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

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

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

.cbpt-modal-icon {
  font-size: 52px;
  text-align: center;
  margin-bottom: 16px;
}

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

.cbpt-modal-copy {
  margin: 0 auto 28px;
  max-width: 560px;
  text-align: center;
  font-size: 18px;
  line-height: 1.7;
  color: #8a8475;
}

.cbpt-modal-context {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #f3d188;
}

.cbpt-modal-context strong,
.cbpt-modal-context span {
  display: block;
}

.cbpt-modal-context strong {
  color: #78350f;
  margin-bottom: 3px;
}

.cbpt-modal-context span {
  color: #92400e;
  font-size: 14px;
}

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

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

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

.cbpt-modal-form input {
  height: 56px;
  width: 100%;
  border-radius: 14px;
  border: 1.5px solid #ddd8d0;
  padding: 0 16px;
  font-size: 18px;
  color: #2d2d2d;
  background: #fff;
}

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

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

.cbpt-modal-submit {
  height: 60px;
  margin-top: 8px;
  border: 0;
  border-radius: 16px;
  background: #b8292d;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}

.cbpt-modal-submit:hover {
  background: #9d1f24;
}

.cbpt-modal-status {
  min-height: 22px;
  margin: 0;
  color: #1b2655;
}

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

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

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

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

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

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

.cbpt-header-left {
  gap: 0;
}

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

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

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

.cbpt-brand-logo {
  display: block;
  height: 34px;
  width: auto;
  object-fit: contain;
}

.cbpt-brand b {
  color: #b8292d;
}

.cbpt-divider {
  width: 1px;
  height: 18px;
  background: #ddd8d0;
  margin: 0 14px;
}

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

.cbpt-badge {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 50px;
  border: 1px solid rgba(27, 38, 85, 0.16);
  color: #1b2655;
  background: rgba(27, 38, 85, 0.05);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.cbpt-timer {
  min-width: 90px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #ddd8d0;
  color: #1b2655;
  background: #f8f5f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "DM Mono", monospace;
  font-size: 16px;
}

.cbpt-progress-line {
  height: 2px;
  background: #e8e4de;
}

.cbpt-progress-line span {
  display: block;
  height: 100%;
  width: 0;
  background: #b8292d;
  transition: width 0.2s ease;
}

.cbpt-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ddd8d0;
  border: 0;
  cursor: pointer;
  padding: 0;
}

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

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

.cbpt-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

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

.cbpt-reading-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 400px;
}

.cbpt-pane {
  min-height: 0;
  overflow-y: auto;
  padding: 32px 36px;
}

.cbpt-pane-left {
  background: #fff;
  border-right: 1px solid #ddd8d0;
}

.cbpt-pane-right {
  background: #f8f5f0;
  padding: 24px 24px 0;
  display: flex;
  flex-direction: column;
}

.cbpt-passage-meta,
.cbpt-language-meta,
.cbpt-question-meta {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a8475;
}

.cbpt-passage-title,
.cbpt-fullpage h2,
.cbpt-language-big,
.cbpt-card-title,
.cbpt-done-card h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: #1b2655;
}

.cbpt-passage-title {
  margin: 5px 0 3px;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
}

.cbpt-passage-subtitle {
  margin-bottom: 18px;
  color: #8a8475;
  font-style: italic;
}

.cbpt-passage-divider {
  height: 1px;
  background: #e8e4de;
  margin-bottom: 18px;
}

.cbpt-passage-body {
  white-space: pre-line;
  font-size: 14.5px;
  line-height: 1.9;
}

.cbpt-question-number,
.cbpt-language-big {
  font-size: 72px;
  font-weight: 400;
  color: rgba(27, 38, 85, 0.05);
  line-height: 1;
}

.cbpt-question-number {
  font-size: 56px;
  margin-bottom: -8px;
}

.cbpt-language-big {
  margin-bottom: -16px;
}

.cbpt-question-meta {
  margin-bottom: 10px;
}

.cbpt-language-meta {
  margin-bottom: 9px;
}

.cbpt-question-stem {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.65;
  color: #1b2655;
}

.cbpt-language-stem {
  margin: 0;
  font-size: 17px;
  line-height: 1.75;
  color: #1b2655;
  white-space: pre-line;
}

.cbpt-blank {
  display: inline-block;
  min-width: 56px;
  border-bottom: 2px solid #b8292d;
  vertical-align: bottom;
}

.cbpt-options,
.cbpt-writing-topics {
  display: flex;
  flex-direction: column;
}

.cbpt-options {
  gap: 8px;
}

.cbpt-language-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.cbpt-writing-topics {
  gap: 10px;
}

.cbpt-option,
.cbpt-language-option,
.cbpt-writing-topic {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid #ddd8d0;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  user-select: none;
}

.cbpt-option {
  border-radius: 8px;
  background: #fff;
  padding: 11px 14px;
}

.cbpt-language-option {
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  background: #f8f5f0;
  padding: 12px 14px;
}

.cbpt-writing-topic {
  align-items: flex-start;
  gap: 14px;
  border-radius: 10px;
  background: #f8f5f0;
  padding: 16px 18px;
  cursor: pointer;
}

.cbpt-option:hover,
.cbpt-language-option:hover,
.cbpt-writing-topic:hover {
  border-color: rgba(27, 38, 85, 0.3);
  box-shadow: 0 1px 4px rgba(27, 38, 85, 0.06);
}

.cbpt-language-option:hover,
.cbpt-writing-topic:hover {
  background: #fff;
}

.cbpt-option.is-selected,
.cbpt-language-option.is-selected,
.cbpt-writing-topic.is-selected {
  background: #fdf2f2;
  border-color: rgba(184, 41, 45, 0.42);
}

.cbpt-option-key,
.cbpt-writing-topic-num {
  border-radius: 6px;
  border: 1px solid #ddd8d0;
  background: #f8f5f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "DM Mono", monospace;
  color: #8a8475;
  flex-shrink: 0;
}

.cbpt-option-key {
  width: 24px;
  height: 24px;
  font-size: 10px;
  font-weight: 500;
}

.cbpt-language-option .cbpt-option-key {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

.cbpt-writing-topic-num {
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
  font-weight: 500;
}

.cbpt-option.is-selected .cbpt-option-key,
.cbpt-language-option.is-selected .cbpt-option-key,
.cbpt-writing-topic.is-selected .cbpt-writing-topic-num {
  border-color: #b8292d;
  background: #b8292d;
  color: #fff;
}

.cbpt-option-text,
.cbpt-writing-topic-text {
  font-size: 13px;
  line-height: 1.4;
}

.cbpt-language-option .cbpt-option-text {
  font-size: 13.5px;
  line-height: 1.35;
}

.cbpt-writing-topic-text {
  font-size: 15px;
  line-height: 1.6;
  color: #1b2655;
}

.cbpt-nav,
.cbpt-language-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cbpt-nav {
  padding: 14px 24px;
  border-top: 1px solid #ddd8d0;
  background: #fff;
}

.cbpt-nav-counter {
  color: #8a8475;
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

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

.cbpt-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cbpt-nav-btn-primary {
  border-color: #b8292d;
  background: #b8292d;
  color: #fff;
}

.cbpt-nav-btn-primary:hover {
  background: #9d1f24;
}

.cbpt-language-body,
.cbpt-writing-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 32px 24px;
  background: #f8f5f0;
}

.cbpt-language-card,
.cbpt-writing-card,
.cbpt-card {
  margin: 0 auto;
  border: 1px solid #ddd8d0;
  background: #fff;
  box-shadow: 0 2px 12px rgba(27, 38, 85, 0.06);
}

.cbpt-card {
  width: min(100%, 760px);
  border-radius: 16px;
}

.cbpt-language-card {
  width: 100%;
  max-width: 640px;
  border-radius: 14px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cbpt-writing-card {
  width: 100%;
  max-width: 720px;
  border-radius: 14px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cbpt-writing-card h2 {
  margin: 0 0 6px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  color: #1b2655;
}

.cbpt-writing-copy {
  margin: 0;
  color: #8a8475;
  font-size: 13px;
  line-height: 1.6;
}

.cbpt-writing-answer-label {
  margin: -6px 0 -12px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8475;
}

.cbpt-writing-textarea {
  width: 100%;
  min-height: 200px;
  border-radius: 10px;
  border: 1.5px solid #ddd8d0;
  padding: 16px;
  font-family: "DM Sans", sans-serif;
  font-size: 14.5px;
  line-height: 1.85;
  color: #2d2d2d;
  background: #fff;
  resize: vertical;
  outline: 0;
  transition: border-color 0.15s ease;
}

.cbpt-writing-textarea:focus {
  border-color: rgba(27, 38, 85, 0.4);
}

.cbpt-writing-textarea::placeholder {
  color: #c0bab0;
}

.cbpt-writing-status {
  min-height: 18px;
  margin: -6px 0 -8px;
  color: #8a8475;
  font-size: 12px;
  line-height: 1.4;
}

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

.cbpt-writing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -10px 0 0;
  color: #8a8475;
  font-size: 12px;
}

.cbpt-writing-meta strong {
  color: #1b2655;
  font-weight: 500;
}

.cbpt-language-nav {
  padding-top: 8px;
  border-top: 1px solid #e8e4de;
}

.cbpt-fullpage {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 40px 48px;
  background: #f8f5f0;
}

.cbpt-card {
  padding: 36px;
}

.cbpt-break-card,
.cbpt-done-card {
  text-align: center;
}

.cbpt-card-kicker {
  margin-bottom: 12px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a8475;
}

.cbpt-break-card h2,
.cbpt-done-card h2 {
  margin: 0 0 12px;
  font-size: 46px;
  font-weight: 400;
}

.cbpt-break-card p,
.cbpt-done-card p {
  max-width: 560px;
  margin: 0 auto 24px;
  color: #8a8475;
  font-size: 18px;
  line-height: 1.7;
}

.cbpt-review-wrap {
  width: min(100%, 900px);
  margin: 0 auto;
}

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

.cbpt-review-brand img {
  width: 30px;
  height: 30px;
}

.cbpt-fullpage h2 {
  margin: 0 0 8px;
  font-size: 58px;
  font-weight: 400;
  line-height: 1.05;
}

.cbpt-review-copy {
  margin: 0 0 28px;
  max-width: 620px;
  color: #8a8475;
  font-size: 14px;
  line-height: 1.6;
}

.cbpt-review-card {
  width: 100%;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 10px 34px rgba(27, 38, 85, 0.11);
}

.cbpt-card-title {
  margin-bottom: 6px;
  font-size: 30px;
  font-weight: 400;
}

.cbpt-card-subtitle {
  margin-bottom: 16px;
  color: #8a8475;
  font-size: 13px;
  line-height: 1.55;
}

.cbpt-review-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #ddd8d0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
  background: #f8f5f0;
}

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

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

.cbpt-review-stats span,
.cbpt-done-grid span,
.cbpt-review-summary dt {
  display: block;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b8292d;
  margin-bottom: 4px;
}

.cbpt-review-stats strong,
.cbpt-done-grid strong,
.cbpt-review-summary dd {
  font-size: 16px;
  font-weight: 700;
  color: #1b2655;
}

.cbpt-review-grid {
  display: grid;
  grid-template-columns: 1fr 268px;
  gap: 20px;
  margin-bottom: 16px;
}

.cbpt-review-panel {
  border-radius: 14px;
  background: #f8f5f0;
  border: 1px solid #e8e4de;
  padding: 20px;
}

.cbpt-review-panel-title {
  margin-bottom: 12px;
  color: #1b2655;
  font-size: 15px;
  font-weight: 700;
}

.cbpt-review-preview {
  min-height: 124px;
  color: #2d2d2d;
  font-size: 14.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.cbpt-review-missing {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 700;
  color: #1b2655;
}

.cbpt-review-missing.is-clear {
  color: #27b47e;
}

.cbpt-review-summary {
  margin: 0;
}

.cbpt-review-summary div {
  margin-bottom: 18px;
}

.cbpt-review-summary dt,
.cbpt-review-summary dd {
  margin: 0;
}

.cbpt-review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 10px;
  background: #f8f5f0;
  border: 1px solid #e8e4de;
  padding: 10px 16px;
}

.cbpt-review-note {
  flex: 1;
  color: #8a8475;
  font-size: 12px;
  line-height: 1.55;
}

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

.cbpt-submit-status {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 13px;
  color: #1b2655;
}

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

.cbpt-done-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 24px 0 28px;
  text-align: left;
}

@media (max-width: 1024px) {
  .cbpt-reading-body {
    grid-template-columns: 1fr;
  }

  .cbpt-pane-left {
    border-right: 0;
    border-bottom: 1px solid #ddd8d0;
    max-height: 38vh;
  }

  .cbpt-review-grid {
    grid-template-columns: 1fr;
  }

  .cbpt-review-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 768px) {
  body.admin-bar .cbpt-app {
    inset: 46px 0 0;
  }

  .cbpt-modal-card {
    padding: 34px 22px 24px;
  }

  .cbpt-modal-card h3 {
    font-size: 38px;
  }

  .cbpt-modal-copy {
    font-size: 16px;
  }

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

  .cbpt-header {
    height: auto;
    padding: 14px 16px;
    flex-wrap: wrap;
  }

  .cbpt-header-left,
  .cbpt-header-right,
  .cbpt-header-middle {
    width: 100%;
  }

  .cbpt-header-middle {
    order: 3;
    justify-content: flex-start;
  }

  .cbpt-reading-body,
  .cbpt-language-body,
  .cbpt-writing-body,
  .cbpt-fullpage {
    flex: 1;
    min-height: 0;
  }

  .cbpt-pane,
  .cbpt-language-card,
  .cbpt-writing-card,
  .cbpt-card {
    padding: 20px;
  }

  .cbpt-passage-title,
  .cbpt-fullpage h2,
  .cbpt-break-card h2,
  .cbpt-done-card h2 {
    font-size: 34px;
  }

  .cbpt-question-stem,
  .cbpt-language-stem,
  .cbpt-passage-body {
    font-size: 17px;
  }

  .cbpt-language-options {
    grid-template-columns: 1fr;
  }

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

  .cbpt-review-stats div {
    border-right: 0;
    border-bottom: 1px solid #ddd8d0;
  }

  .cbpt-review-stats div:last-child {
    border-bottom: 0;
  }

  .cbpt-review-buttons {
    flex-direction: column;
  }

  .cbpt-nav {
    padding: 14px 16px;
  }
}
