/* ── 1.3 Peek Panel ── */
.doc-peek-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  background: var(--color-card);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 500;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.165, 0.85, 0.45, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.doc-peek-panel.active {
  transform: translateX(0);
}

.doc-peek-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.doc-peek-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 12px;
}

.doc-peek-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.doc-peek-close:hover {
  background: var(--color-bg);
  color: var(--color-text-primary);
}

.doc-peek-meta {
  padding: 12px 20px;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  display: flex;
  gap: 16px;
}

.doc-peek-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-primary);
}

.doc-peek-content h1,
.doc-peek-content h2,
.doc-peek-content h3,
.doc-peek-content h4,
.doc-peek-content h5,
.doc-peek-content h6 {
  font-weight: 600;
  line-height: 1.3;
  margin: 1em 0 0.5em;
  color: var(--color-text-primary);
}

.doc-peek-content h1 { font-size: 1.4em; }
.doc-peek-content h2 { font-size: 1.2em; }
.doc-peek-content h3 { font-size: 1.1em; }
.doc-peek-content h4,
.doc-peek-content h5,
.doc-peek-content h6 { font-size: 1em; }

.doc-peek-content p {
  margin-bottom: 0.75em;
}

.doc-peek-content ul,
.doc-peek-content ol {
  padding-left: 1.5em;
  margin-bottom: 0.75em;
}

.doc-peek-content ul {
  list-style: disc;
}

.doc-peek-content ol {
  list-style: decimal;
}

.doc-peek-content li {
  margin-bottom: 0.25em;
}

.doc-peek-content blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 12px;
  margin: 0.75em 0;
  color: var(--color-text-secondary);
}

.doc-peek-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.doc-peek-content img {
  max-width: 100%;
  border-radius: 4px;
}

.doc-peek-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.doc-peek-actions {
  padding: 12px 20px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.doc-peek-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  z-index: 499;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.doc-peek-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 767px) {
  .doc-peek-panel {
    width: 100vw;
  }
}

/* ── 1.5 Empty State Templates ── */
.empty-templates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-width: 560px;
  margin-top: 20px;
  width: 100%;
}

.empty-template-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-card);
  border: 0.5px solid rgba(31, 31, 30, 0.12);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.empty-template-card:hover {
  border-color: rgba(31, 31, 30, 0.25);
  box-shadow: rgba(0, 0, 0, 0.035) 0px 4px 20px 0px;
}

.empty-template-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}
