/* ProgressView: scoped, dependency-free theme. Override --sp-* on the host.
   No motion or audio is needed to understand progress; no avatar assets are fetched. */
.study-progress {
  --sp-ink: #233649;
  --sp-muted: #607083;
  --sp-paper: #f8f6f1;
  --sp-card: #ffffff;
  --sp-line: #dbe1e5;
  --sp-accent: #386854;
  --sp-soft: #e7efe9;
  color: var(--sp-ink);
  font:
    400 15px/1.55 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  container-type: inline-size;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.study-progress *,
.study-progress *::before,
.study-progress *::after {
  box-sizing: border-box;
}
.study-progress h2,
.study-progress h3,
.study-progress h4,
.study-progress p {
  margin: 0;
}
.study-progress h2 {
  font-size: clamp(1.65rem, 4cqi, 2.25rem);
  letter-spacing: -0.045em;
  line-height: 1.12;
  font-weight: 650;
}
.study-progress h3 {
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-weight: 650;
}
.study-progress h4 {
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 650;
}
.study-progress button,
.study-progress select,
.study-progress input {
  font: inherit;
}
.study-progress button {
  cursor: pointer;
  touch-action: manipulation;
}
.study-progress button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.study-progress :focus-visible {
  outline: 3px solid #b47129;
  outline-offset: 3px;
}
.sp-hero {
  display: grid;
  grid-template-columns: minmax(140px, 225px) minmax(0, 1fr);
  gap: clamp(22px, 5cqi, 48px);
  align-items: center;
  background: var(--sp-paper);
  padding: clamp(20px, 5cqi, 42px);
  border: 1px solid var(--sp-line);
  border-radius: 24px;
}
.sp-portrait {
  min-width: 0;
}
.sp-portrait svg,
.sp-editor-preview svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 270px;
  margin-inline: auto;
}
.sp-eyebrow {
  color: var(--sp-accent);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.69rem;
  font-weight: 750;
  margin-bottom: 8px !important;
}
.sp-level {
  margin-block: 22px 7px !important;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.sp-level span {
  color: var(--sp-muted);
  font-size: 0.82rem;
  font-weight: 500;
}
.study-progress progress {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  height: 6px;
  border-radius: 9px;
  background: var(--sp-line);
  accent-color: var(--sp-accent);
  display: block;
  width: 100%;
  overflow: hidden;
}
.study-progress progress::-webkit-progress-bar {
  background: var(--sp-line);
  border-radius: 9px;
}
.study-progress progress::-webkit-progress-value {
  background: var(--sp-accent);
  border-radius: 9px;
}
.study-progress progress::-moz-progress-bar {
  background: var(--sp-accent);
  border-radius: 9px;
}
.study-progress .sp-xp {
  height: 8px;
  margin-bottom: 9px;
}
.sp-small {
  font-size: 0.8rem;
  color: var(--sp-muted);
}
.sp-note {
  font-size: 0.88rem;
  margin-top: 16px !important;
  max-width: 56ch;
}
.sp-stats {
  display: flex;
  gap: clamp(14px, 3cqi, 28px);
  padding-top: 22px;
  flex-wrap: wrap;
}
.sp-stats span {
  font-size: 0.7rem;
  color: var(--sp-muted);
}
.sp-stats b {
  display: block;
  color: var(--sp-ink);
  font-weight: 650;
  font-size: 1.3rem;
  line-height: 1.25;
}
.sp-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-block: 24px;
  background: var(--sp-paper);
  border: 1px solid var(--sp-line);
  border-radius: 14px;
}
.sp-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--sp-muted);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  font-size: 0.83rem;
  font-weight: 650;
  line-height: 1.3;
}
.sp-tabs button[aria-selected='true'] {
  color: var(--sp-ink);
  background: var(--sp-card);
  box-shadow: 0 1px 4px #23364918;
}
.sp-panel {
  min-width: 0;
}
.sp-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}
.sp-panel-heading .sp-small {
  margin-top: 6px;
}
.sp-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.study-progress label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  min-width: 0;
}
.study-progress input,
.study-progress select {
  display: block;
  width: 100%;
  border: 1px solid var(--sp-line);
  border-radius: 9px;
  color: var(--sp-ink);
  background: var(--sp-card);
  min-height: 46px;
  padding: 10px 12px;
  margin-top: 6px;
  font-size: 0.88rem;
  font-weight: 400;
}
.study-progress select {
  padding-right: 26px;
  text-overflow: ellipsis;
}
.sp-policy {
  border: 1px solid var(--sp-line);
  border-radius: 11px;
  padding: 2px 14px;
  background: var(--sp-paper);
  margin-block: 15px 20px;
}
.study-progress summary {
  cursor: pointer;
  min-height: 44px;
  padding-block: 10px;
  font-weight: 600;
  font-size: 0.8rem;
}
.study-progress details p {
  color: var(--sp-muted);
  font-size: 0.82rem;
  margin-block: 0 12px;
  max-width: 85ch;
}
.sp-skill-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.sp-skill {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--sp-line);
  border-radius: 15px;
  background: var(--sp-card);
}
.sp-skill-top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sp-skill h4 {
  overflow-wrap: anywhere;
  max-width: 45ch;
}
.sp-course {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--sp-muted);
  margin-bottom: 5px;
}
.sp-pill {
  white-space: nowrap;
  font-size: 0.67rem;
  font-weight: 650;
  border-radius: 99px;
  background: #eff1f3;
  color: #586471;
  padding: 4px 9px;
}
.sp-pill.sp-review {
  color: #8b4c29;
  background: #f8eadc;
}
.sp-pill.sp-developing {
  color: #446b86;
  background: #e8eff5;
}
.sp-pill.sp-strong {
  color: #2d6449;
  background: #e2eee5;
}
.sp-evidence {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}
.sp-evidence progress {
  flex: 1;
  min-width: 30px;
}
.sp-evidence span {
  font-size: 0.64rem;
  color: var(--sp-muted);
}
.sp-skill details {
  margin-top: 6px;
}
.sp-skill details summary {
  color: var(--sp-muted);
  font-weight: 500;
}
.sp-text-button {
  border: 0;
  background: transparent;
  color: var(--sp-accent);
  padding: 9px 0;
  min-height: 44px;
  font-weight: 650 !important;
  font-size: 0.82rem !important;
}
.sp-button {
  background: var(--sp-accent);
  color: white;
  border: 0;
  padding: 11px 17px;
  min-height: 44px;
  border-radius: 10px;
  font-size: 0.85rem !important;
  font-weight: 650 !important;
}
.sp-more {
  display: block;
  margin: 20px auto 10px;
}
.sp-count {
  margin: 14px 0 4px !important;
  text-align: center;
}
.sp-empty {
  grid-column: 1/-1;
  padding: 42px 20px;
  border: 1px dashed var(--sp-line);
  border-radius: 15px;
  text-align: center;
}
.sp-empty-mark {
  font-size: 2.5rem;
  line-height: 1;
  color: var(--sp-accent);
  display: block;
  margin-bottom: 12px;
}
.sp-empty p {
  max-width: 48ch;
  margin: 9px auto 0 !important;
  color: var(--sp-muted);
  font-size: 0.88rem;
}
.sp-editor {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(0, 1.5fr);
  gap: 28px;
  align-items: start;
}
.sp-editor-preview {
  position: sticky;
  top: 16px;
  text-align: center;
}
.sp-editor-preview p {
  margin-top: 12px;
}
.sp-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.sp-palettes {
  grid-column: 1/-1;
  display: grid;
  gap: 14px;
  margin-top: 4px;
}
.sp-palettes fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.sp-palettes legend {
  font-size: 0.78rem;
  font-weight: 650;
  margin-bottom: 7px;
}
.sp-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sp-swatches button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 2px solid transparent;
  border-radius: 50%;
  padding: 5px;
  background: transparent;
  display: grid;
  place-items: center;
}
.sp-swatches button span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--sp-swatch);
  border-radius: 50%;
  color: white;
  text-shadow: 0 1px 3px #000;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px #23364920;
}
.sp-swatches button[aria-pressed='true'] {
  border-color: var(--sp-accent);
}
.sp-save-status {
  margin-block: 18px 12px !important;
  font-size: 0.82rem;
  color: var(--sp-muted);
}
.sp-unlocks {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  padding: 0;
  margin: 3px 0 17px;
}
.sp-unlocks li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--sp-line);
  padding-bottom: 7px;
}
.sp-unlocks b {
  font-size: 0.69rem;
  white-space: nowrap;
  color: var(--sp-muted);
}
.sp-achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.sp-achievement {
  display: flex;
  gap: 17px;
  padding: 22px;
  border: 1px solid var(--sp-line);
  border-radius: 15px;
  background: var(--sp-card);
}
.sp-achievement p {
  margin-block: 6px 12px;
  font-size: 0.8rem;
  color: var(--sp-muted);
}
.sp-achievement progress {
  height: 5px;
  margin-bottom: 5px;
}
.sp-badge {
  position: relative;
  width: 52px;
  height: 58px;
  flex-shrink: 0;
}
.sp-badge svg {
  width: 100%;
  height: 100%;
  fill: var(--sp-paper);
  stroke: var(--sp-line);
  stroke-width: 2;
}
.sp-badge-tick {
  display: none;
}
.sp-badge span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: var(--sp-muted);
  font-weight: 700;
}
.sp-earned .sp-badge svg {
  fill: var(--sp-soft);
  stroke: #a1b9a9;
}
.sp-earned .sp-badge span {
  color: var(--sp-accent);
}
.sp-warning {
  padding: 14px 17px;
  background: #fbf1d8;
  color: #715621;
  border-radius: 12px;
  margin-bottom: 16px !important;
  font-size: 0.84rem;
}
@container (max-width: 640px) {
  .sp-skill-list,
  .sp-achievement-grid {
    grid-template-columns: 1fr;
  }
  .sp-hero {
    grid-template-columns: 108px minmax(0, 1fr);
    padding: 22px;
    gap: 18px;
    align-items: start;
  }
  .sp-stats {
    gap: 15px;
  }
  .sp-note {
    grid-column: 1/-1;
  }
  .sp-level {
    margin-top: 13px !important;
  }
  .sp-editor {
    grid-template-columns: 1fr;
    gap: 21px;
  }
  .sp-editor-preview {
    position: static;
  }
  .sp-editor-preview svg {
    width: 170px;
  }
}
@container (max-width: 420px) {
  .sp-hero {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .sp-portrait {
    width: 124px;
    margin-inline: auto;
  }
  .sp-hero h2,
  .sp-eyebrow {
    text-align: center;
  }
  .sp-stats {
    justify-content: space-between;
  }
  .sp-tabs {
    gap: 0;
    padding: 4px;
  }
  .sp-tabs button {
    padding: 9px 5px;
    font-size: 0.72rem;
  }
  .sp-filters {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .sp-skill {
    padding: 17px;
  }
  .sp-panel-heading {
    align-items: start;
  }
  .sp-controls {
    gap: 12px;
  }
  .sp-unlocks {
    grid-template-columns: 1fr;
  }
  .sp-achievement {
    padding: 18px;
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .study-progress *,
  .study-progress *::before,
  .study-progress *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  .study-progress progress {
    forced-color-adjust: auto;
  }
  .sp-swatches button span {
    forced-color-adjust: none;
  }
}
