/* Customize Your Course — uses site tokens so light and dark themes stay in sync. */

.nav-label-short { display: none; }

@media (min-width: 1024px) and (max-width: 1540px) {
  .main-nav .nav-label-full { display: none; }
  .main-nav .nav-label-short { display: inline; }
}

@media (min-width: 1024px) {
  .site-shell:has(.cc-page) {
    grid-template-columns: 214px minmax(0, 1460px);
  }
  .spelling-side-link[data-side="customize"] {
    align-items: flex-start;
  }
  .spelling-side-link[data-side="customize"] .spelling-side-icon {
    margin-top: 0.18rem;
  }
}

body:has(.cc-page) .subscribe-fab {
  display: none !important;
}

.cc-page {
  --cc-listening: #6366f1;
  --cc-reading: #e11d48;
  --cc-writing: #ea580c;
  --cc-speaking: #059669;
  --cc-resources: #0284c7;
  --cc-ready: #7c3aed;
  color: var(--text);
}

.cc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.15rem;
}

.cc-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.cc-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
}

.cc-head .page-lead {
  margin: 0.45rem 0 0;
  max-width: 58ch;
  font-size: 0.98rem;
}

.cc-steps {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  margin: 0;
  padding: 0.55rem 0.45rem;
  list-style: none;
  flex: 1 1 28rem;
  max-width: 40rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow-sm);
}

.cc-step-item {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.cc-step-item:not(:last-child)::after {
  content: "";
  width: 1.1rem;
  height: 2px;
  margin-inline-start: 0.2rem;
  border-radius: 2px;
  background: var(--border);
  flex: 0 0 auto;
}

.cc-step-item.is-done:not(:last-child)::after,
.cc-step-item.is-current:not(:last-child)::after {
  background: color-mix(in srgb, var(--primary) 70%, var(--border));
}

.cc-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
  padding: 0.25rem 0.35rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.cc-step:hover {
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  color: var(--text);
}

.cc-step-num {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.cc-step-num .cc-svg {
  width: 0.85rem;
  height: 0.85rem;
}

.cc-step-item.is-current .cc-step-num {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.cc-step-item.is-done .cc-step-num {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
}

.cc-step-item.is-current .cc-step-title,
.cc-step-item.is-done .cc-step-title {
  color: var(--text);
}

.cc-step-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cc-step-title {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.cc-step-title--short { display: none; }

.cc-step-hint {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.25;
}

.cc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.cc-panel,
.cc-cart-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow-sm);
}

.cc-panel {
  padding: 0.95rem 0.95rem 1rem;
}

.cc-cart-card {
  padding: 0.95rem;
}

.cc-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cc-panel-head h2 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 1.05rem;
}

.cc-panel-head h2 .cc-svg,
.cc-quote-title .cc-svg,
.cc-cart-kicker .cc-svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

.cc-panel-head p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.cc-text-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0.15rem;
}

.cc-text-btn:hover:not(:disabled) { color: var(--danger); }
.cc-text-btn:disabled { opacity: 0.4; cursor: default; }

.cc-cat + .cc-cat { margin-top: 0.25rem; }

.cc-cat-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.4rem 0.15rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
}

.cc-cat-toggle:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }

.cc-cat-name {
  font-size: 0.92rem;
}

.cc-cat-count {
  min-width: 1.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--primary) 14%, var(--surface-solid));
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.cc-cat-chevron {
  margin-inline-start: auto;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: transform 0.25s var(--ease-out);
}

.cc-cat-chevron .cc-svg { width: 1rem; height: 1rem; }
.cc-cat.is-open .cc-cat-chevron { transform: rotate(180deg); }

.cc-cat-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s var(--ease-out);
}

.cc-cat.is-open .cc-cat-panel { grid-template-rows: 1fr; }

.cc-cat-panel-inner { overflow: hidden; }

.cc-mod-list {
  display: grid;
  gap: 0.45rem;
  padding: 0.15rem 0.1rem 0.55rem;
}

.cc-mod {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  padding: 0.62rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.2s var(--ease-out),
    background 0.2s;
}

.cc-mod:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.cc-mod.is-selected {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, var(--bg-elevated));
}

.cc-icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 11px;
  background: color-mix(in srgb, var(--cc-tone, var(--primary)) 16%, var(--surface-solid));
  color: var(--cc-tone, var(--primary));
  flex: 0 0 auto;
}

.cc-icon--sm {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 9px;
}

.cc-icon .cc-svg,
.cc-add .cc-svg,
.cc-remove .cc-svg {
  width: 1.15rem;
  height: 1.15rem;
}

.cc-icon--sm .cc-svg { width: 1rem; height: 1rem; }

.cc-tone-listening { --cc-tone: var(--cc-listening); }
.cc-tone-reading { --cc-tone: var(--cc-reading); }
.cc-tone-writing { --cc-tone: var(--cc-writing); }
.cc-tone-speaking { --cc-tone: var(--cc-speaking); }
.cc-tone-resources { --cc-tone: var(--cc-resources); }
.cc-tone-ready { --cc-tone: var(--cc-ready); }

[data-theme="dark"] .cc-icon {
  color: color-mix(in srgb, var(--cc-tone, var(--primary)) 62%, white);
}

.cc-mod-copy,
.cc-plan-copy { min-width: 0; }

.cc-mod-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.cc-mod-desc,
.cc-plan-desc {
  display: block;
  margin-top: 0.12rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.cc-add {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--primary) 45%, var(--border));
  color: var(--primary);
  background: var(--surface-solid);
  transition: transform 0.25s var(--ease-spring), background 0.2s, color 0.2s, border-color 0.2s;
}

.cc-mod:hover .cc-add { transform: scale(1.06); }

.cc-add.is-on {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}

.cc-mod.is-fresh .cc-add.is-on {
  animation: cc-check-pop 0.38s var(--ease-spring);
}

.cc-mod.is-fresh .cc-add.is-on .cc-svg path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: cc-draw 0.35s var(--ease-out) forwards;
}

@keyframes cc-check-pop {
  0% { transform: scale(0.6); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes cc-draw {
  to { stroke-dashoffset: 0; }
}

.cc-plan-list {
  display: grid;
  gap: 0.5rem;
}

.cc-plan-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.7rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
}

.cc-plan-item h3 {
  margin: 0;
  font-size: 0.92rem;
}

.cc-plan-cat {
  margin: 0.1rem 0 0;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cc-plan-desc { margin: 0.15rem 0 0; }

.cc-item-in { animation: cc-in 0.28s var(--ease-out); }

.cc-plan-item.is-leaving,
.cc-plan-list.is-leaving {
  animation: cc-out 0.22s var(--ease-out) forwards;
  pointer-events: none;
}

@keyframes cc-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes cc-out {
  to { opacity: 0; transform: translateY(6px); }
}

.cc-remove {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.cc-remove:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.cc-qty {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.cc-qty-btn {
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.cc-qty-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.cc-qty-btn:disabled { opacity: 0.35; cursor: default; }

.cc-qty-val {
  min-width: 1.1rem;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cc-qty-unit {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.cc-empty {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  padding: 1.6rem 1rem 1.8rem;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 70%),
    var(--bg-elevated);
}

.cc-empty p {
  margin: 0;
  max-width: 32ch;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.cc-empty-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface-solid));
  color: var(--primary);
}

.cc-empty-mark .cc-svg { width: 1.35rem; height: 1.35rem; }

.cc-cart { min-width: 0; }

.cc-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.4rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cc-count.is-pop,
.cc-stats dd.is-pop { animation: cc-pop 0.35s var(--ease-spring); }

@keyframes cc-pop {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.cc-stats {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
}

.cc-stats div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.cc-stats dt {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.cc-stats dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: end;
}

.cc-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

.cc-chip {
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--cc-tone, var(--primary)) 14%, var(--surface-solid));
  color: var(--cc-tone, var(--primary-dark));
  font-size: 0.7rem;
  font-weight: 800;
}

[data-theme="dark"] .cc-chip {
  color: color-mix(in srgb, var(--cc-tone, var(--primary)) 55%, white);
}

.cc-muted { color: var(--text-muted); font-size: 0.82rem; }

.cc-cart-kicker {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.4rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cc-cart-list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.cc-cart-list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  font-weight: 600;
}

.cc-cart-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--cc-tone, var(--primary));
  flex: 0 0 auto;
}

.cc-cart-qty {
  color: var(--text-muted);
  font-weight: 700;
}

.cc-cart-empty { margin: 0 0 0.85rem; }

.cc-quote {
  margin-bottom: 0.85rem;
  padding: 0.8rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface-2));
}

.cc-quote-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  font-weight: 800;
}

.cc-quote p:last-child {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.cc-config-note {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  background: var(--alert-warn-bg);
  color: var(--alert-warn-text);
  font-size: 0.78rem;
}

.cc-config-note code {
  font-size: 0.74rem;
}

.cc-confirm { margin-top: 0.15rem; }
.cc-confirm .cc-wa { width: 1.05rem; height: 1.05rem; }

.cc-page .btn:disabled,
.cc-page .btn:disabled:hover {
  animation: none;
  transform: none;
  box-shadow: none;
}

.cc-send-note {
  margin: 0.55rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.cc-preview { border-top: 1px solid var(--border); padding-top: 0.65rem; }

.cc-preview summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.cc-preview summary::-webkit-details-marker { display: none; }

.cc-preview summary .cc-svg {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  transition: transform 0.25s var(--ease-out);
}

.cc-preview[open] summary .cc-svg { transform: rotate(180deg); }

.cc-bubble {
  margin-top: 0.65rem;
  padding: 0.7rem 0.75rem 0.55rem;
  border-radius: 14px 14px 14px 5px;
  background: #d9fdd3;
  color: #111b21;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .cc-bubble {
  background: #005c4b;
  color: #e7f8ef;
}

.cc-bubble-name {
  margin: 0 0 0.25rem;
  color: #0b6b4f;
  font-size: 0.75rem;
  font-weight: 800;
}

[data-theme="dark"] .cc-bubble-name { color: #9be7c4; }

.cc-bubble-text {
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: normal;
}

.cc-bubble-text strong { font-weight: 800; }

.cc-bubble-note {
  margin: 0.45rem 0 0;
  color: #3d5c4a;
  font-size: 0.68rem;
  text-align: right;
}

[data-theme="dark"] .cc-bubble-note { color: #b7e0cc; }

.cc-modules,
.cc-plan,
.cc-cart { scroll-margin-top: calc(var(--header-h) + 0.75rem); }

.cc-page button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.cc-dock { display: none; }

.cc-page > .cp-lang {
  margin-bottom: 0.85rem;
}

.cc-page--ar,
.cc-page--ar * {
  letter-spacing: 0;
}

.cc-page--ar {
  line-height: 1.65;
}

.cc-page--ar .cc-head h1 {
  line-height: 1.35;
}

.cc-page--ar .cc-kicker,
.cc-page--ar .cc-plan-cat,
.cc-page--ar .cc-cart-kicker {
  text-transform: none;
}

.cc-page--ar .cc-mod-desc,
.cc-page--ar .cc-plan-desc,
.cc-page--ar .cc-quote p:last-child,
.cc-page--ar .cc-send-note,
.cc-page--ar .page-lead,
.cc-page--ar .cc-step-hint {
  line-height: 1.6;
}

@media (min-width: 768px) {
  .cc-layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    grid-template-areas:
      "modules cart"
      "plan cart";
  }
  .cc-modules { grid-area: modules; }
  .cc-plan { grid-area: plan; }
  .cc-cart {
    grid-area: cart;
    position: sticky;
    top: calc(var(--header-h) + 0.6rem);
  }
  .cc-cart-card {
    max-height: calc(100dvh - var(--header-h) - 1.3rem);
    overflow: auto;
  }
}

@media (min-width: 1280px) {
  .cc-layout {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.96fr) minmax(250px, 310px);
    grid-template-areas: "modules plan cart";
  }
}

@media (max-width: 767px) {
  .cc-head { align-items: stretch; }
  .cc-steps {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
  }
  .cc-step-title--full,
  .cc-step-hint { display: none; }
  .cc-step-title--short { display: block; }
  .cc-step-item:not(:last-child)::after { width: 0.55rem; }
  .cc-page { padding-bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px)); }
  .cc-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
  }
  .cc-dock-count {
    margin: 0;
    min-width: 4.2rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.15;
  }
  .cc-dock-count strong {
    display: block;
    color: var(--text);
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
  }
  .cc-dock .btn { min-height: 2.6rem; flex: 1; }
  .cc-dock .btn-outline { flex: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-page *,
  .cc-page *::before,
  .cc-page *::after {
    animation: none !important;
    transition: none !important;
  }
}
