.pp-hero {
  padding-bottom: 20px;
}

.pp-hero-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 30px 24px 40px;
  text-align: center;
}

.pp-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.pp-title .accent {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pp-subtitle {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 1rem;
}

.pp-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Loading */
.pp-loading {
  max-width: 420px;
  margin: 40px auto;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-dim);
}

.pp-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: pp-spin 0.9s linear infinite;
}

@keyframes pp-spin {
  to { transform: rotate(360deg); }
}

/* Layout */
.pp-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}

.hidden { display: none !important; }

/* Sidebar */
.pp-sidebar {
  padding: 16px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.pp-category {
  margin-bottom: 18px;
}

.pp-category:last-child {
  margin-bottom: 0;
}

.pp-category-title {
  font-size: 0.78rem;
  color: var(--accent2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  padding: 0 8px;
}

.pp-problem-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pp-problem-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.pp-problem-item.active {
  background: rgba(124, 92, 255, 0.15);
  color: var(--text);
  font-weight: 600;
}

/* Panel */
.pp-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.pp-desc-card,
.pp-editor-card,
.pp-result-card {
  padding: 20px;
}

.pp-desc-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.pp-difficulty {
  margin-top: 4px;
  color: var(--accent2);
  font-size: 0.85rem;
}

.pp-subheading {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--accent2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

.pp-lesson-section {
  margin-top: 8px;
  padding: 14px 16px;
  background: rgba(124, 92, 255, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}

.pp-lesson-section .pp-subheading {
  margin-top: 0;
  color: var(--accent);
}

.pp-lesson {
  margin-top: 10px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

.pp-description {
  margin-top: 10px;
  color: var(--text-dim);
  white-space: pre-wrap;
  line-height: 1.7;
}

.pp-editor-header,
.pp-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.pp-editor-buttons {
  display: flex;
  gap: 8px;
}

.pp-btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.pp-code {
  width: 100%;
  min-height: 280px;
  background: #0c0c12;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
  tab-size: 4;
}

.pp-code:disabled {
  opacity: 0.5;
}

.pp-status {
  font-weight: 600;
}

.pp-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pp-test-result {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.88rem;
}

.pp-test-pass {
  border-color: rgba(51, 224, 106, 0.35);
}

.pp-test-fail {
  border-color: rgba(224, 92, 92, 0.35);
}

.pp-test-head {
  font-weight: 700;
  margin-bottom: 6px;
}

.pp-test-pass .pp-test-head { color: #33e06a; }
.pp-test-fail .pp-test-head { color: #e05c5c; }

.pp-test-line {
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  word-break: break-all;
  margin-top: 2px;
}

.pp-test-error {
  margin-top: 8px;
  padding: 10px;
  background: rgba(224, 92, 92, 0.08);
  border-radius: 8px;
  color: #e08a8a;
  font-size: 0.8rem;
  white-space: pre-wrap;
  overflow-x: auto;
}

@media (max-width: 820px) {
  .pp-layout {
    grid-template-columns: 1fr;
  }

  .pp-sidebar {
    position: static;
    max-height: none;
  }
}
