.hero-actions form { margin: 0; }
.user-pill { background: rgba(255,255,255,.16); padding: 10px 14px; border-radius: 12px; font-weight: bold; }
.docs-layout { display: grid; grid-template-columns: 360px 1fr; gap: 20px; padding: 12px 24px 24px; }
.docs-sidebar { padding: 18px; align-self: start; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.docs-content { min-height: calc(100vh - 165px); }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.search-form button { padding: 12px 14px; }
.tree-head { margin-top: 22px; }
.tree-head h2 { margin: 0; color: var(--teal-dark); }
.tree-head p, .muted { color: var(--muted); }
.tree-list, .tree-list ul { list-style: none; padding-left: 0; margin: 0; }
.tree-list ul { padding-left: 18px; }
.tree-node summary { list-style: none; margin-top: 6px; }
.tree-node summary::-webkit-details-marker { display: none; }
.tree-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text); text-decoration: none; padding: 10px 12px; border-radius: 12px; background: #f8fbfb; border: 1px solid var(--border); }
.tree-link:hover, .tree-link.active { background: #e6f4f4; border-color: var(--teal); }
.level-1 > details > summary .tree-link { font-weight: bold; }
.level-2 > details > summary .tree-link { font-size: 14px; }
.level-3 > details > summary .tree-link { font-size: 13px; }
.doc-dot { color: var(--teal); font-size: 12px; }
.new-category { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.new-category h3, .search-results h3 { color: var(--teal-dark); margin-bottom: 8px; }
select, textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px; font-size: 14px; font-family: Arial, sans-serif; background: white; }
textarea { font-family: Consolas, Monaco, monospace; line-height: 1.5; }
.doc-head { border-bottom: 1px solid var(--border); padding-bottom: 18px; }
.danger { background: var(--bad); }
.danger:hover { background: #9f2020; }
.markdown-body { margin-top: 24px; line-height: 1.65; font-size: 16px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: var(--teal-dark); }
.markdown-body table { border-collapse: collapse; width: 100%; margin: 18px 0; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 10px; text-align: left; }
.markdown-body blockquote { border-left: 5px solid var(--teal); margin-left: 0; padding: 8px 18px; background: #f4fafb; color: var(--muted); }
.markdown-body code { background: #eef3f4; padding: 2px 6px; border-radius: 6px; }
.markdown-body pre code { background: transparent; padding: 0; }
.editor { margin-top: 30px; border-top: 1px solid var(--border); padding-top: 10px; }
.editor summary { padding: 12px 0; }
.empty-state { margin-top: 24px; background: #f8fbfb; border: 1px dashed var(--border); border-radius: 16px; padding: 24px; color: var(--muted); }
.empty-state.large { display: grid; place-items: center; text-align: center; min-height: 420px; }
.result-item { display: block; padding: 12px; border: 1px solid var(--border); border-radius: 12px; margin: 8px 0; background: #fff; color: var(--text); text-decoration: none; }
.result-item span, .result-item small { display: block; color: var(--muted); margin-top: 4px; }
mark { background: #fff2a8; padding: 0 2px; border-radius: 3px; }
@media (max-width: 1000px) { .docs-layout { grid-template-columns: 1fr; } .docs-sidebar { position: static; max-height: none; } }
@media (max-width: 600px) { .search-form { grid-template-columns: 1fr; } .docs-layout { padding: 12px; } }


/* v0.2 document list + versioning */

.documents-panel {
  margin-top: 24px;
}

.documents-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.documents-panel-head h3 {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 24px;
}

.doc-list {
  display: grid;
  gap: 10px;
}

.doc-list-item {
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: #fafafa;
  border-radius: 14px;
  padding: 14px 16px;
}

.doc-list-item:hover,
.doc-list-item.active {
  border-color: var(--teal);
  background: #e8f6f6;
}

.doc-list-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--teal-dark);
}

.doc-list-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.new-doc {
  min-width: 260px;
}

.new-doc summary {
  background: var(--teal);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
}

.new-doc[open] summary {
  margin-bottom: 14px;
}

.soft-sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 28px 0 20px;
}

.document-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.document-meta h2 {
  margin: 0 0 6px;
  color: var(--teal-dark);
}

.document-meta p {
  margin: 0;
  color: var(--muted);
}

.versions-box {
  min-width: 280px;
}

.versions-box summary {
  background: #f5f8f9;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 12px;
}

.versions-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.version-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: white;
}

.version-row.current {
  border-color: var(--teal);
  background: #edfafa;
}

.version-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.version-row a {
  color: var(--teal-dark);
  font-weight: bold;
  text-decoration: none;
  font-size: 13px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 16px 0 0;
}

.check-row input {
  width: auto;
}

.delete-box {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.delete-box summary {
  color: var(--bad);
}

@media (max-width: 900px) {
  .documents-panel-head,
  .document-meta {
    flex-direction: column;
  }

  .new-doc,
  .versions-box {
    width: 100%;
  }
}
