/* ── Guide page styles ── */

#view-guide {
  overflow-y: auto;
  justify-content: flex-start;
  background: var(--ps-off-white);
  scrollbar-width: thin;
  scrollbar-color: var(--ps-border) transparent;
}
#view-guide::-webkit-scrollbar { width: 6px; }
#view-guide::-webkit-scrollbar-track { background: transparent; }
#view-guide::-webkit-scrollbar-thumb { background: var(--ps-border); border-radius: 3px; }

.guide-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 56px 32px 0;
}

/* ── Hero ── */
.guide-hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

/* ── Concepts card (right side of hero) ── */
.guide-concepts {
  background: var(--ps-surface);
  border: 1.5px solid var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 20px 22px 24px;
}

.guide-concepts-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ps-text-muted);
  margin-bottom: 18px;
}

.concept-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.concept-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}

.concept-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--ps-azul);
  color: #fff;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.concept-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.concept-body strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ps-text-primary);
}

.concept-body span {
  font-size: 12.5px;
  color: var(--ps-text-muted);
  line-height: 1.55;
}

/* ── XML compare section ── */
.guide-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.compare-side {
  border: 1.5px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  overflow: hidden;
}

.compare-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1.5px solid var(--ps-border);
}

.compare-label.plain {
  background: var(--ps-surface);
  color: var(--ps-text-muted);
}

.compare-label.xml {
  background: var(--ps-azul-faint);
  color: var(--ps-azul-dark);
}

.compare-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.compare-side.plain .compare-dot {
  background: var(--ps-border-strong);
}

.compare-side.xml .compare-dot {
  background: var(--ps-azul);
}

.compare-body {
  padding: 14px 16px;
}

.plain-text {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.9;
  color: var(--ps-text-muted);
  white-space: pre-wrap;
  margin: 0;
}

/* ── XML syntax highlight classes ── */
.xt-b { color: rgba(255, 255, 255, .28); }
.xt-t { color: #8FBFC7; }
.xt-v { color: rgba(255, 255, 255, .8); }

/* ── Code block ── */
.guide-code {
  background: var(--ps-sidebar);
  border-radius: var(--ps-radius-sm);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.85;
  white-space: pre;
  overflow-x: auto;
  padding: 14px 18px;
  margin: 0;
  color: rgba(255, 255, 255, .8);
}

/* ── Playground ── */
.guide-playground {
  background: var(--ps-surface);
  border: 1.5px solid var(--ps-border);
  border-radius: var(--ps-radius);
  overflow: hidden;
  margin-top: 24px;
}

.guide-pg-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1.5px solid var(--ps-border);
  background: #fff;
}

.guide-pg-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ps-text-primary);
  flex: 1;
}

.guide-pg-sublabel {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ps-text-muted);
}

.guide-pg-reset {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ps-text-muted);
  background: transparent;
  border: 1.5px solid var(--ps-border);
  border-radius: var(--ps-radius-pill);
  padding: 4px 12px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.guide-pg-reset:hover {
  color: var(--ps-terracotta);
  border-color: var(--ps-terracotta);
}

/* ── Playground tabs ── */
.guide-pg-tabs {
  display: flex;
  flex-direction: row;
  border-bottom: 1.5px solid var(--ps-border);
  background: #fff;
  overflow-x: auto;
}

.pg-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ps-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1.5px;
  white-space: nowrap;
  user-select: none;
}

.pg-tab:hover {
  color: var(--ps-text-secondary);
}

.pg-tab.pg-active {
  color: var(--ps-text-primary);
  border-bottom-color: var(--ps-azul);
  font-weight: 600;
}

.pg-tab.pg-done {
  color: var(--ps-verde-dark);
}

.pg-tab-num {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--ps-surface);
  border: 1.5px solid var(--ps-border);
  color: var(--ps-text-muted);
  transition: background .15s, color .15s, border-color .15s;
}

.pg-tab.pg-active .pg-tab-num {
  background: var(--ps-azul);
  color: #fff;
  border-color: var(--ps-azul);
}

.pg-tab.pg-done .pg-tab-num {
  background: var(--ps-verde);
  color: #fff;
  border-color: var(--ps-verde);
}

/* ── Playground split ── */
.guide-pg-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.guide-pg-left {
  padding: 22px 24px;
  border-right: 1.5px solid var(--ps-border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guide-pg-right {
  background: var(--ps-sidebar);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
}

.pg-step-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ps-text-primary);
  letter-spacing: -.2px;
}

.pg-step-desc {
  font-size: 13px;
  color: var(--ps-text-secondary);
  line-height: 1.7;
}

.pg-step-insight {
  background: var(--ps-azul-faint);
  border: 1.5px solid var(--ps-azul-light);
  border-left: 3px solid var(--ps-azul);
  border-radius: var(--ps-radius-xs);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--ps-azul-dark);
  line-height: 1.6;
}

.pg-preview-label {
  font-family: var(--mono);
  font-size: 9.5px;
  color: rgba(255, 255, 255, .2);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.pg-preview-blocks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.pg-block {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.85;
  white-space: pre;
  animation: pgIn .2s ease;
}

@keyframes pgIn {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Playground nav ── */
.guide-pg-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1.5px solid var(--ps-border);
  background: #fff;
}

.guide-pg-nav-flex {
  flex: 1;
}

.pg-copied-msg {
  font-size: 12px;
  font-weight: 600;
  color: var(--ps-verde-dark);
  background: var(--ps-verde-faint);
  border: 1.5px solid var(--ps-verde-light);
  border-radius: var(--ps-radius-pill);
  padding: 4px 12px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}

.pg-copied-msg.visible {
  opacity: 1;
}

.pg-back-btn {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ps-text-muted);
  background: transparent;
  border: 1.5px solid var(--ps-border);
  border-radius: var(--ps-radius-pill);
  padding: 6px 14px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  visibility: hidden;
}

.pg-back-btn:hover {
  color: var(--ps-text-primary);
  border-color: var(--ps-border-strong);
}

/* ── Tips ── */
.tips-rows { display: flex; flex-direction: column; gap: 20px; margin-top: 28px; }
.tips-row-label { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tips-row-badge { font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 10px; border-radius: var(--ps-radius-pill); }
.tips-row-badge.beginner { color: var(--ps-verde-dark); background: var(--ps-verde-faint); border: 1.5px solid var(--ps-verde-light); }
.tips-row-badge.advanced { color: var(--ps-azul-dark); background: var(--ps-azul-faint); border: 1.5px solid var(--ps-azul-light); }

.tips-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.tip-card { background: var(--ps-surface); border: 1.5px solid var(--ps-border); border-radius: var(--ps-radius-sm); padding: 16px 18px; }

.tip-xml { font-family: var(--mono); font-size: 11px; color: var(--ps-text-muted); margin-bottom: 10px; }
.tip-xml .bracket { color: var(--ps-border-strong); }

.tip-title { font-size: 13px; font-weight: 700; color: var(--ps-text-primary); margin-bottom: 5px; }
.tip-body { font-size: 12.5px; color: var(--ps-text-secondary); line-height: 1.6; }

/* ── Patterns ── */
.pattern-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.pattern-card {
  background: var(--ps-surface);
  border: 1.5px solid var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 20px;
}

.pattern-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ps-text-primary);
  margin-bottom: 6px;
}

.pattern-card-desc {
  font-size: 13px;
  color: var(--ps-text-secondary);
  line-height: 1.65;
  margin-bottom: 14px;
}

.pattern-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pattern-tag-chip {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--ps-azul-faint);
  border: 1.5px solid var(--ps-azul-light);
  color: var(--ps-azul-dark);
  border-radius: var(--ps-radius-pill);
  padding: 2px 8px;
}

/* ── Footer ── */
.guide-footer {
  margin-top: 56px;
  padding: 24px 0 32px;
  text-align: center;
  border-top: 1.5px solid var(--ps-border);
}

.guide-footer-line {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ps-text-muted);
  letter-spacing: .04em;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .guide-hero {
    grid-template-columns: 1fr;
  }

  .guide-compare {
    grid-template-columns: 1fr;
  }

  .guide-pg-split {
    grid-template-columns: 1fr;
  }

  .guide-pg-right {
    min-height: 220px;
    border-right: none;
    border-top: 1.5px solid var(--ps-border);
  }

  .tips-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pattern-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .tips-grid {
    grid-template-columns: 1fr;
  }

  .guide-content {
    padding: 32px 18px 0;
  }
}
