.ccstsim,
.ccstsim * {
  box-sizing: border-box;
}

.ccstsim {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --line: #e6ebf2;
  --line-strong: #d7e0eb;
  --text: #1f2937;
  --text-soft: #5f6b7a;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --success: #16a34a;
  --success-soft: #effcf3;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warning: #d97706;
  --warning-soft: #fff7ed;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 32px 0;
}

.ccstsim__loading,
.ccstsim__fatal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow);
}

.ccstsim__screen,
.ccstsim__panel,
.ccstsim__card,
.ccstsim__history-card,
.ccstsim__category-card,
.ccstsim__review-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.ccstsim__hero,
.ccstsim__panel,
.ccstsim__card,
.ccstsim__review-card,
.ccstsim__history-card,
.ccstsim__category-card {
  padding: 28px;
}

.ccstsim__hero {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  margin-bottom: 24px;
}

.ccstsim__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ccstsim h2,
.ccstsim h3,
.ccstsim h4 {
  margin: 0;
  color: var(--text);
  line-height: 1.2;
}

.ccstsim h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  margin-top: 16px;
}

.ccstsim h3 {
  font-size: clamp(1.4rem, 2vw, 1.9rem);
}

.ccstsim p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.8;
}

.ccstsim__hero-stats,
.ccstsim__field-grid,
.ccstsim__grid,
.ccstsim__button-row,
.ccstsim__chips,
.ccstsim__category-grid,
.ccstsim__history-grid,
.ccstsim__layout,
.ccstsim__nav-grid,
.ccstsim__progress-list,
.ccstsim__review-grid,
.ccstsim__option-list,
.ccstsim__footer-actions {
  display: grid;
  gap: 16px;
}

.ccstsim__grid--home {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
}

.ccstsim__grid--results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 24px 0;
}

.ccstsim__layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  align-items: start;
}

.ccstsim__field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.ccstsim__button-row {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 24px;
}

.ccstsim__button-row--compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 0;
}

.ccstsim__chips {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 20px;
}

.ccstsim__chip,
.ccstsim__mini-pill,
.ccstsim__category-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.ccstsim__pill {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.ccstsim__pill strong {
  font-size: 1.8rem;
  line-height: 1;
}

.ccstsim__pill span {
  color: var(--text-soft);
  font-size: 14px;
}

.ccstsim__field {
  display: grid;
  gap: 10px;
}

.ccstsim__field span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.ccstsim input,
.ccstsim select,
.ccstsim button {
  font: inherit;
}

.ccstsim input,
.ccstsim select {
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.ccstsim input:focus,
.ccstsim select:focus,
.ccstsim button:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.ccstsim__button {
  min-height: 56px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.ccstsim__button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.ccstsim__button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.ccstsim__button--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.ccstsim__button--ghost {
  background: var(--panel-soft);
}

.ccstsim__button--danger {
  color: var(--danger);
  border-color: #fecaca;
  background: #fff;
}

.ccstsim__panel-head,
.ccstsim__headline-row,
.ccstsim__results-hero,
.ccstsim__progress-head,
.ccstsim__stickybar,
.ccstsim__stickygroup,
.ccstsim__review-head,
.ccstsim__category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ccstsim__panel-head,
.ccstsim__headline-row {
  align-items: start;
  margin-bottom: 22px;
}

.ccstsim__category-grid,
.ccstsim__history-grid,
.ccstsim__review-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 20px;
}

.ccstsim__category-card,
.ccstsim__history-card,
.ccstsim__review-card {
  padding: 22px;
}

.ccstsim__category-head {
  align-items: start;
}

.ccstsim__emoji {
  font-size: 1.6rem;
}

.ccstsim__history-card,
.ccstsim__review-card,
.ccstsim__progress-card,
.ccstsim__score-row {
  display: grid;
  gap: 10px;
}

.ccstsim__stickybar {
  position: sticky;
  top: 18px;
  z-index: 5;
  padding: 16px;
  margin-bottom: 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.ccstsim__stickygroup {
  flex-wrap: wrap;
}

.ccstsim__scenario,
.ccstsim__empty,
.ccstsim__review-answer,
.ccstsim__explanation {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.ccstsim__scenario,
.ccstsim__explanation,
.ccstsim__review-answer {
  line-height: 1.8;
}

.ccstsim__option-list {
  margin-top: 24px;
}

.ccstsim__option {
  width: 100%;
  display: flex;
  align-items: start;
  gap: 14px;
  text-align: left;
  min-height: 68px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.ccstsim__option:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.ccstsim__option:disabled {
  cursor: default;
}

.ccstsim__option.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.ccstsim__option.is-correct {
  border-color: #86efac;
  background: var(--success-soft);
}

.ccstsim__option.is-wrong {
  border-color: #fca5a5;
  background: var(--danger-soft);
}

.ccstsim__option-bullet {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.ccstsim__explanation {
  margin-top: 22px;
}

.ccstsim__explanation--success {
  background: var(--success-soft);
  border-color: #86efac;
}

.ccstsim__explanation--danger {
  background: var(--danger-soft);
  border-color: #fca5a5;
}

.ccstsim__explanation--warning {
  background: var(--warning-soft);
  border-color: #fdba74;
}

.ccstsim__footer-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.ccstsim__sidebar {
  display: grid;
  gap: 20px;
}

.ccstsim__nav-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.ccstsim__nav-dot {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.ccstsim__nav-dot.is-current {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.ccstsim__nav-dot.is-answered {
  background: #eefdf3;
  border-color: #bbf7d0;
}

.ccstsim__meter {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef2f7;
}

.ccstsim__meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.ccstsim__panel--results-hero {
  margin-bottom: 24px;
}

.ccstsim__results-hero {
  align-items: center;
}

.ccstsim__score-ring {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
}

.ccstsim__score-ring::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
}

.ccstsim__score-ring > div {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  text-align: center;
}

.ccstsim__score-ring strong {
  font-size: 2rem;
  line-height: 1;
}

.ccstsim__toast-host {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin-bottom: 16px;
}

.ccstsim__toast {
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #fff;
  font-weight: 700;
}

.ccstsim__toast--success { border-color: #86efac; background: var(--success-soft); }
.ccstsim__toast--warning { border-color: #fdba74; background: var(--warning-soft); }
.ccstsim__toast--danger { border-color: #fca5a5; background: var(--danger-soft); }

@media (max-width: 1100px) {
  .ccstsim__hero,
  .ccstsim__grid--home,
  .ccstsim__layout,
  .ccstsim__grid--results,
  .ccstsim__footer-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .ccstsim__field-grid,
  .ccstsim__nav-grid,
  .ccstsim__category-grid,
  .ccstsim__history-grid,
  .ccstsim__review-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ccstsim__panel,
  .ccstsim__hero,
  .ccstsim__category-card,
  .ccstsim__history-card,
  .ccstsim__review-card {
    padding: 20px;
  }

  .ccstsim__panel-head,
  .ccstsim__headline-row,
  .ccstsim__results-hero,
  .ccstsim__stickybar,
  .ccstsim__stickygroup,
  .ccstsim__review-head,
  .ccstsim__category-head {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .ccstsim__field-grid,
  .ccstsim__nav-grid,
  .ccstsim__category-grid,
  .ccstsim__history-grid,
  .ccstsim__review-grid,
  .ccstsim__button-row,
  .ccstsim__chips {
    grid-template-columns: 1fr;
  }
}
