/* ==========================================================================
   MD Server — layout + markdown theme. Light/dark via CSS variables.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-elev: #f6f8fa;
  --bg-sidebar: #fbfcfd;
  --text: #1f2328;
  --text-muted: #656d76;
  --border: #d0d7de;
  --border-muted: #e6e8eb;
  --link: #0969da;
  --accent: #0969da;
  --accent-soft: #ddf4ff;
  --code-bg: #f6f8fa;
  --code-text: #1f2328;
  --quote-border: #d0d7de;
  --table-stripe: #f6f8fa;
  --shadow: 0 1px 3px rgba(31, 35, 40, 0.08), 0 1px 2px rgba(31, 35, 40, 0.06);
  --topbar-h: 52px;
  --sidebar-w: 280px;
  --toc-w: 232px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo",
          Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-sidebar: #0d1117;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --border-muted: #21262d;
  --link: #4493f8;
  --accent: #4493f8;
  --accent-soft: #163356;
  --code-bg: #161b22;
  --code-text: #e6edf3;
  --quote-border: #30363d;
  --table-stripe: #161b22;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-soft); }

/* --- topbar --------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.search { flex: 1; max-width: 520px; }
.search input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
}
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.theme-toggle {
  margin-left: auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle-icon::before { content: "\2600"; font-size: 16px; }   /* sun */
[data-theme="dark"] .theme-toggle-icon::before { content: "\263E"; } /* moon */

/* --- layout --------------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 18px 12px 40px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
}

.content { min-width: 0; padding: 0 40px; }

/* draggable divider between the sidebar and the content (adjusts --sidebar-w) */
.col-resizer {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: var(--sidebar-w);
  width: 9px;
  margin-left: -4px;
  z-index: 30;
  cursor: col-resize;
  background: transparent;
}
.col-resizer::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 4px;
  width: 1px;
  background: var(--border);
  transition: background 0.12s ease, width 0.12s ease;
}
.col-resizer:hover::before, .col-resizer.is-dragging::before, .col-resizer:focus-visible::before {
  width: 3px; left: 3px;
  background: var(--accent);
}
.col-resizer:focus { outline: none; }
body.col-resizing { cursor: col-resize; user-select: none; }
body.col-resizing iframe { pointer-events: none; }

.toc {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 24px 16px 40px;
  font-size: 13px;
}

/* --- sidebar nav ---------------------------------------------------------- */

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 6px 8px 8px;
}
.nav-tree { margin-top: 22px; }

.project-list, .tree { list-style: none; margin: 0; padding: 0; }

.project-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}
.project-list a:hover { background: var(--bg-elev); text-decoration: none; }
.project-list .is-active > a { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.project-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px solid var(--border-muted);
  border-radius: 10px;
  padding: 0 7px;
  min-width: 20px;
  text-align: center;
}
.nav-empty { color: var(--text-muted); font-size: 13px; padding: 6px 8px; }

/* tree */
.tree { padding-left: 0; }
.tree .tree { padding-left: 14px; border-left: 1px solid var(--border-muted); margin-left: 8px; }
.tree-file a, .tree-toggle {
  display: block;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.tree-file a:hover, .tree-toggle:hover { background: var(--bg-elev); text-decoration: none; }
.tree-file.is-active > a { background: var(--accent-soft); font-weight: 600; }
.tree-toggle { color: var(--text-muted); font-weight: 600; }
.tree-caret {
  display: inline-block;
  width: 0; height: 0;
  margin-right: 6px;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transform: rotate(90deg);
  transition: transform 0.12s ease;
  vertical-align: middle;
}
.tree-dir.is-collapsed > .tree-toggle .tree-caret { transform: rotate(0deg); }
.tree-dir.is-collapsed > .tree { display: none; }

/* --- table of contents ---------------------------------------------------- */

.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list a {
  display: block;
  padding: 3px 8px;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  line-height: 1.35;
}
.toc-list a:hover { color: var(--text); text-decoration: none; }
.toc-list a.is-current { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc-l3 a { padding-left: 20px; font-size: 12.5px; }
.toc-l4 a { padding-left: 32px; font-size: 12.5px; }

/* --- generic page chrome -------------------------------------------------- */

.doc-wrap { max-width: 860px; margin: 0 auto; padding: 28px 0 80px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 0 0 6px; }
.page-sub { color: var(--text-muted); margin: 0; }

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs .crumb-doc { color: var(--text); }
.breadcrumbs .raw-link {
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 9px;
  font-size: 12px;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 64px 20px;
}
.empty-state code { background: var(--code-bg); padding: 2px 6px; border-radius: 5px; }
.error-code { font-size: 64px; margin: 0; color: var(--text-muted); }

/* --- project cards -------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.card {
  display: block;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card-title { font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.card-meta { color: var(--text-muted); font-size: 13px; }

/* index: per-company section */
.company-block { margin-bottom: 34px; }
.company-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 1.3em;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.company-head a { color: var(--text); }
.company-meta { font-size: 12px; color: var(--text-muted); font-weight: 400; }

/* --- search results ------------------------------------------------------- */

.search-results { list-style: none; margin: 0; padding: 0; }
.search-hit { padding: 14px 0; border-bottom: 1px solid var(--border-muted); }
.hit-title { font-size: 16px; font-weight: 600; }
.hit-path { font-size: 12px; color: var(--text-muted); margin: 2px 0 6px; font-family: var(--mono); }
.hit-snippet { font-size: 14px; color: var(--text); }
.hit-snippet mark, .hit-title mark { background: var(--accent-soft); color: inherit; padding: 0 1px; border-radius: 3px; }

/* search filters */
.search-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 18px; }
.search-filters input[type="search"] { flex: 1 1 240px; min-width: 180px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.search-filters select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); max-width: 200px; }
.search-filters input:focus, .search-filters select:focus { outline: none;
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.badge { display: inline-block; margin-left: 8px; padding: 1px 8px; font-size: 12px;
  font-weight: 600; color: var(--text-muted); background: var(--code-bg);
  border: 1px solid var(--border); border-radius: 999px; vertical-align: middle; }
.badge-fts { color: #1a7f37; border-color: #9ed3b0; background: #e6f4ea; }

/* 관리 허브 */
.admin-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 8px; }
.hub-card { display: block; padding: 18px 18px 16px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg); color: var(--text); transition: border-color .12s ease, box-shadow .12s ease; }
.hub-card:hover { border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; }
.hub-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.hub-desc { margin-top: 6px; font-size: 13px; color: var(--text-muted); }
.hub-badge { font-size: 12px; font-weight: 700; color: #fff; background: var(--accent);
  border-radius: 999px; padding: 1px 8px; min-width: 20px; text-align: center; }
.hub-badge--muted { color: var(--text-muted); background: var(--code-bg); border: 1px solid var(--border); }

/* git 연동 목록 */
.git-table td { vertical-align: middle; }
.git-table .git-remote code { font-size: 12px; word-break: break-all; }
.git-target { font-weight: 600; }
.scope-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px;
  border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); background: var(--code-bg); }
.scope-global { color: #1a7f37; border-color: #9ed3b0; background: #e6f4ea; }
.scope-company { color: #0969da; border-color: #aacdf5; background: #e8f0fe; }
.scope-project { color: var(--text-muted); }
.git-run-row { margin-top: 14px; gap: 12px; align-items: center; flex-wrap: wrap; }

/* 상단 계정 드롭다운 */
.topbtn--accent { color: var(--accent); font-weight: 700; }
.user-dd { position: relative; display: inline-block; }
.user-trigger { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.dd-caret { font-size: 10px; opacity: .7; }
.user-dd-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 90;
  min-width: 168px; padding: 6px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); }
.user-dd-menu a { display: block; padding: 8px 12px; border-radius: 7px; font-size: 14px; color: var(--text); }
.user-dd-menu a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.dd-sep { height: 1px; background: var(--border-muted); margin: 5px 4px; }

/* 설정 페이지 카드 */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.settings-card { margin: 0 0 22px; padding: 18px 20px; border: 1px solid var(--border-muted);
  border-radius: 12px; background: var(--bg); }
.settings-card h2 { margin: 0 0 6px; font-size: 17px; }
.settings-card .form { margin-top: 12px; }
.settings-danger { border-color: #e5b3b3; }
.check-inline { display: inline-flex; gap: 8px; align-items: center; margin: 2px 0 10px; font-size: 13px; color: var(--text-muted); }
.check-inline input { width: auto; }
.badge-danger { color: #b42318; border-color: #e5b3b3; background: #fdeceb; }
.git-log { margin-top: 12px; }
.git-log summary { cursor: pointer; font-size: 13px; color: var(--text-muted); }
.log-pre { margin-top: 8px; max-height: 320px; overflow: auto; font-size: 12px; line-height: 1.5;
  padding: 12px; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px;
  white-space: pre-wrap; word-break: break-word; }

/* 인쇄/PDF 페이지 */
.print-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px; }
.print-actions { display: flex; gap: 10px; align-items: center; }
.print-head { margin: 0 0 24px; padding-bottom: 12px; border-bottom: 2px solid var(--border); }
.print-group { margin-top: 32px; }
.print-doc { padding: 8px 0 16px; }
.print-doc-path { font-size: 12px; font-family: var(--mono); margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px dashed var(--border-muted); }
@media print {
  .topbar, .sidebar, .toc, .no-print, .print-bar, .col-resizer { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; }
  .print-doc { page-break-after: always; }
  .print-doc:last-child { page-break-after: auto; }
  .markdown-body .diagram, .markdown-body pre, .markdown-body table { page-break-inside: avoid; }
}

/* tags + backlinks */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  font-size: 13px; color: var(--accent); background: var(--accent-soft);
  border: 1px solid transparent; border-radius: 999px; }
.tag-chip:hover { border-color: var(--accent); }
.tag-count { font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: var(--bg); border-radius: 999px; padding: 0 6px; }
.doc-meta { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border-muted);
  display: flex; flex-direction: column; gap: 16px; }
.doc-meta .dm-label { display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.doc-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.doc-tags .dm-label { margin: 0 4px 0 0; }
.doc-backlinks ul { margin: 0; padding-left: 18px; }
.doc-backlinks li { margin: 2px 0; }

/* right-click context menu (tree rename) */
.ctx-menu {
  position: fixed;
  z-index: 80;
  min-width: 148px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.ctx-item:hover { background: var(--accent-soft); color: var(--accent); }
.ctx-item.ctx-danger { color: #b42318; }
.ctx-item.ctx-danger:hover { background: #fdeceb; }

/* sidebar tree filter */
.tree-filter { margin: 14px 0 0; }
.tree-filter input { width: 100%; padding: 6px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.tree-filter input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tree-filter-empty { font-size: 12px; margin: 6px 2px 0; }

/* ==========================================================================
   Markdown body
   ========================================================================== */

.markdown-body { word-wrap: break-word; }
.markdown-body > *:first-child { margin-top: 0; }

.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  margin: 28px 0 16px;
  font-weight: 600;
  line-height: 1.25;
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}
.markdown-body h1 { font-size: 2em; padding-bottom: 0.3em; border-bottom: 1px solid var(--border); }
.markdown-body h2 { font-size: 1.5em; padding-bottom: 0.3em; border-bottom: 1px solid var(--border); }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1em; }
.markdown-body h5 { font-size: 0.9em; }
.markdown-body h6 { font-size: 0.85em; color: var(--text-muted); }

.markdown-body .header-anchor {
  float: left;
  margin-left: -0.85em;
  padding-right: 0.2em;
  color: var(--text-muted);
  opacity: 0;
  text-decoration: none;
}
.markdown-body h1:hover .header-anchor,
.markdown-body h2:hover .header-anchor,
.markdown-body h3:hover .header-anchor,
.markdown-body h4:hover .header-anchor { opacity: 1; }

.markdown-body p, .markdown-body ul, .markdown-body ol,
.markdown-body blockquote, .markdown-body table, .markdown-body pre,
.markdown-body dl { margin: 0 0 16px; }

.markdown-body ul, .markdown-body ol { padding-left: 2em; }
.markdown-body li { margin: 0.2em 0; }
.markdown-body li > input[type="checkbox"] { margin: 0 0.4em 0 -1.3em; }
.markdown-body .contains-task-list { list-style: none; padding-left: 1.2em; }

.markdown-body blockquote {
  padding: 0 1em;
  color: var(--text-muted);
  border-left: 0.25em solid var(--quote-border);
}

.markdown-body hr { height: 1px; border: 0; background: var(--border); margin: 24px 0; }

.markdown-body img { max-width: 100%; }

/* inline + block code */
.markdown-body code {
  font-family: var(--mono);
  font-size: 85%;
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 6px;
}
.markdown-body pre {
  position: relative;
  padding: 14px 16px;
  overflow: auto;
  background: var(--code-bg);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  line-height: 1.45;
}
.markdown-body pre code { background: none; padding: 0; font-size: 90%; }

/* code-block "복사" button (added by app.js) */
.code-copy {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease;
}
.markdown-body pre:hover .code-copy,
.code-copy:focus { opacity: 1; }
.code-copy:hover { color: var(--fg); border-color: var(--accent); }

/* KaTeX: keep display math from overflowing the page width */
.markdown-body .katex-display { overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.markdown-body .highlight { margin: 0 0 16px; }
.markdown-body .highlight pre { margin: 0; }

/* tables */
.markdown-body table { border-collapse: collapse; display: block; overflow: auto; width: max-content; max-width: 100%; }
.markdown-body th, .markdown-body td { padding: 7px 13px; border: 1px solid var(--border); }
.markdown-body th { font-weight: 600; background: var(--bg-elev); }
.markdown-body tr:nth-child(2n) td { background: var(--table-stripe); }

/* footnotes */
.markdown-body .footnotes { font-size: 0.88em; color: var(--text-muted); border-top: 1px solid var(--border); margin-top: 36px; }

/* --- diagrams ------------------------------------------------------------- */

.diagram {
  margin: 0 0 18px;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border-muted);
  border-radius: 10px;
  overflow-x: auto;
  text-align: center;
}
.diagram svg { max-width: 100%; height: auto; }
.diagram--mermaid .mermaid { margin: 0; }
/* PlantUML SVGs are server-rendered with fixed (light) colors, so keep their
   card white in both themes — a clean, intentional look in dark mode. */
.diagram--plantuml { background: #ffffff; }
.diagram--error {
  text-align: left;
  background: #fff5f5;
  border-color: #f1aeb5;
}
[data-theme="dark"] .diagram--error { background: #2a1416; border-color: #6e2d31; }
.diagram-error-title { font-weight: 700; color: #b42318; margin: 0 0 4px; }
[data-theme="dark"] .diagram-error-title { color: #ff7b72; }
.diagram-error-msg { font-family: var(--mono); font-size: 12.5px; margin: 0 0 8px; white-space: pre-wrap; }

/* --- scrollbars ----------------------------------------------------------- */

.sidebar::-webkit-scrollbar, .toc::-webkit-scrollbar,
.markdown-body pre::-webkit-scrollbar { width: 10px; height: 10px; }
.sidebar::-webkit-scrollbar-thumb, .toc::-webkit-scrollbar-thumb,
.markdown-body pre::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }

/* --- responsive ----------------------------------------------------------- */

.sidebar-toggle { display: none; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-resizer { display: none; }
  .content { padding: 0 18px; }
  .sidebar {
    position: fixed;
    left: 0; top: var(--topbar-h);
    width: 84%; max-width: 320px;
    z-index: 25;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-toggle {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
  }
}

/* ==========================================================================
   Auth · forms · buttons · admin · editor  (login / RBAC feature)
   ========================================================================== */

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; font-size: 14px; font-family: inherit; line-height: 1.2;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 7px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-danger { background: #d1242f; border-color: #d1242f; color: #fff; }
.btn-danger:hover { filter: brightness(1.06); border-color: #d1242f; }
.btn-danger-ghost { color: #d1242f; }
.btn-danger-ghost:hover { border-color: #d1242f; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 10px; }

/* forms */
.form { max-width: 460px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; font-size: 14px; font-family: inherit;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 7px;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.row-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.form-error {
  background: #fff5f5; border: 1px solid #f1aeb5; color: #b42318;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 14px;
}
[data-theme="dark"] .form-error { background: #2a1416; border-color: #6e2d31; color: #ff7b72; }
.danger-box {
  background: #fff5f5; border: 1px solid #f1aeb5; color: #86181d;
  border-radius: 8px; padding: 12px 14px; margin-bottom: 16px;
}
[data-theme="dark"] .danger-box { background: #2a1416; border-color: #6e2d31; color: #ffb3ab; }
.muted { color: var(--text-muted); }

/* topbar user menu */
.user-menu { display: flex; align-items: center; gap: 8px; }
.topbtn { font-size: 13px; color: var(--text); padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.topbtn:hover { background: var(--bg); text-decoration: none; }
.user-id { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.user-role {
  display: inline-block; font-size: 11px; background: var(--accent-soft); color: var(--accent);
  padding: 1px 7px; border-radius: 10px; margin-left: 2px;
}
.mini-add { float: right; color: var(--accent); font-weight: 700; padding: 0 4px; }
.mini-add:hover { text-decoration: none; }

/* auth pages */
.page-auth { background: var(--bg-elev); }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 384px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 12px; padding: 28px; box-shadow: var(--shadow);
}
.auth-brand { margin-bottom: 18px; }
.auth-title { font-size: 20px; margin: 0 0 6px; }
.auth-help { color: var(--text-muted); font-size: 13.5px; margin: 0 0 18px; }
.auth-alt { margin-top: 16px; font-size: 13.5px; color: var(--text-muted); text-align: center; }
.auth-card .form { max-width: none; }
.auth-card .btn-block { margin-top: 6px; }

/* page head row + sections */
.page-head--row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.section-h { font-size: 16px; margin: 30px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.badge { font-size: 12px; background: var(--bg-elev); border: 1px solid var(--border-muted);
  border-radius: 10px; padding: 1px 8px; color: var(--text-muted); font-weight: 600; }

/* admin: user cards */
.user-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
  margin-bottom: 12px; background: var(--bg); }
.user-card.is-disabled { opacity: 0.6; }
.user-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.role-tag { font-size: 11px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border); }
.role-superadmin { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.role-admin { background: var(--bg-elev); color: var(--text-muted); }
.role-disabled { background: #ffe3e3; color: #b42318; border-color: transparent; }
.field-label { font-size: 13px; color: var(--text-muted); margin: 6px 0; }
.chk-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; }
.chk { font-size: 13.5px; display: inline-flex; align-items: center; gap: 5px; }
.user-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-muted); }
/* 승인 대기 카드: 승인/거절을 우측 하단에 가로 배치 */
.card-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-muted); }
.user-controls select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); font-size: 13px; }

/* admin: companies table */
.admin-table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 9px 12px;
  border-bottom: 1px solid var(--border-muted); font-size: 14px; }
.admin-table th { color: var(--text-muted); font-weight: 600; font-size: 12.5px; }
.ta-right { text-align: right; }

/* project management page (관리 > 프로젝트 관리) */
.admin-proj-co { margin-top: 22px; }
.apc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 2px solid var(--border); padding-bottom: 6px; }
.apc-head h2 { margin: 0; font-size: 17px; }
.proj-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.admin-proj-co .admin-table td { vertical-align: middle; }

.inline-add { display: flex; gap: 8px; margin: 14px 0; }
.inline-add input { flex: 1; max-width: 320px; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--text); }

/* company cards with delete */
.card--with-actions { position: relative; padding: 0; }
.card-main { display: block; padding: 18px; color: var(--text); }
.card-main:hover { text-decoration: none; }
.card-del { position: absolute; top: 8px; right: 10px; font-size: 12px;
  color: var(--text-muted); opacity: 0; }
.card--with-actions:hover .card-del { opacity: 1; }
.card-del:hover { color: #d1242f; text-decoration: none; }

/* doc actions in breadcrumb */
.doc-actions { margin-left: auto; display: inline-flex; gap: 8px; }
.doc-actions .raw-link { margin-left: 0; }
.raw-link--danger { color: #d1242f; }

/* sidebar project manage links */
.tree-manage { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border-muted);
  display: flex; flex-direction: column; gap: 4px; }
.tree-manage a { font-size: 13px; color: var(--accent); padding: 3px 8px; }
.tree-manage a.danger { color: #d1242f; }

/* editor */
.page-editor .content { padding: 0 24px; }
.editor-wrap { max-width: 1120px; margin: 0 auto; padding: 24px 0 60px; }
.editor-newrow { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.editor-newrow .field { flex: 1 1 320px; }
.editor-newrow .field--template { flex: 0 0 200px; }
.editor-toolbar { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; align-items: center; }
.editor-spacer { flex: 1 1 12px; min-width: 12px; }
.btn--field { flex: 0 0 auto; align-self: flex-end; }

/* pop-out preview window */
body.preview-window { margin: 0; background: var(--bg); color: var(--text); }
.pw-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; background: var(--bg-elev); border-bottom: 1px solid var(--border); }
.pw-spacer { flex: 1; }
.pw-body { max-width: 880px; margin: 0 auto; padding: 24px 22px 80px; }
.save-status { font-size: 13px; }
.save-status.is-ok { color: #1a7f37; font-weight: 600; }
.save-status.is-err { color: #b42318; font-weight: 600; }

/* markdown format toolbar */
.md-toolbar { display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
  margin: 14px 0 0; padding: 6px; border: 1px solid var(--border-muted);
  border-radius: 8px; background: var(--bg-soft, var(--code-bg)); }
.md-btn { min-width: 34px; height: 30px; padding: 0 9px; font-size: 13px;
  color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; line-height: 1; }
.md-btn:hover { border-color: var(--accent); color: var(--accent); }
.md-btn b, .md-btn i, .md-btn s { font-size: 14px; }
.md-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.editor-panes { display: grid; grid-template-columns: 1fr; gap: 16px; }
.editor-textarea { width: 100%; min-height: 62vh; padding: 14px 16px; resize: vertical;
  font-family: var(--mono); font-size: 14px; line-height: 1.6; color: var(--text);
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; }
.editor-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor-preview { border: 1px solid var(--border-muted); border-radius: 8px; padding: 16px 20px;
  background: var(--bg); overflow: auto; min-height: 62vh; }
@media (min-width: 1000px) {
  .editor-wrap.is-split .editor-panes { grid-template-columns: 1fr 1fr; }
}

/* install wizard */
.form-ok { background: #e6f4ea; border: 1px solid #9ed3b0; color: #1a7f37;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
[data-theme="dark"] .form-ok { background: #0f2417; border-color: #2ea04366; color: #3fb950; }
.auth-card--wide { max-width: 560px; }
.db-group { margin-bottom: 2px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field--port { max-width: 120px; flex: 0 0 120px; }
.install-test { margin: 10px 0; padding: 10px 12px; border-radius: 8px; font-size: 13.5px;
  border: 1px solid var(--border); background: var(--bg-elev); white-space: pre-wrap; }
.install-test.is-ok { background: #e6f4ea; border-color: #9ed3b0; color: #1a7f37; }
.install-test.is-err { background: #fff5f5; border-color: #f1aeb5; color: #b42318; }
[data-theme="dark"] .install-test.is-ok { background: #0f2417; border-color: #2ea04366; color: #3fb950; }
[data-theme="dark"] .install-test.is-err { background: #2a1416; border-color: #6e2d31; color: #ff7b72; }

/* drag-and-drop upload */
.dropzone { margin: 8px 0; padding: 14px 10px; border: 1.5px dashed var(--border);
  border-radius: 8px; text-align: center; font-size: 12.5px; color: var(--text-muted);
  cursor: pointer; background: var(--bg); transition: border-color .12s, background .12s; }
.dropzone:hover { border-color: var(--accent); color: var(--text); }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dz-text { line-height: 1.45; pointer-events: none; }
.dz-result { margin: 6px 0; padding: 8px 10px; border-radius: 7px; font-size: 12.5px;
  border: 1px solid var(--border); background: var(--bg-elev); word-break: break-all; }
.dz-result.is-ok { background: #e6f4ea; border-color: #9ed3b0; color: #1a7f37; }
.dz-result.is-warn { background: #fff8e1; border-color: #f0d48a; color: #8a6d00; }
.dz-result.is-err { background: #fff5f5; border-color: #f1aeb5; color: #b42318; }
[data-theme="dark"] .dz-result.is-ok { background: #0f2417; border-color: #2ea04366; color: #3fb950; }
[data-theme="dark"] .dz-result.is-warn { background: #241e09; border-color: #9e7e1f; color: #d4a72c; }
[data-theme="dark"] .dz-result.is-err { background: #2a1416; border-color: #6e2d31; color: #ff7b72; }
.dz-errs { margin: 4px 0 0; padding-left: 18px; text-align: left; }

/* 내 업로드 (staging) — 눈에 띄는 카드 */
.staging { margin: 12px 10px 0; padding: 12px; border: 1px solid var(--accent);
  border-radius: 10px; background: var(--accent-soft); }
.staging-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.staging-title { font-size: 13.5px; font-weight: 800; color: var(--accent); }
.staging-count { font-size: 11px; font-weight: 700; color: #fff; background: var(--accent);
  border-radius: 999px; padding: 1px 8px; min-width: 18px; text-align: center; }
.staging-only { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.staging-dz { margin: 0 0 8px; padding: 10px; background: var(--bg); border-style: dashed; }
.staging-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.staging-item { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 7px;
  font-size: 13px; background: var(--bg); border: 1px solid var(--border-muted); }
.staging-item:hover { border-color: var(--accent); }
.staging-item.is-dragging { opacity: .4; }
.staging-item.is-new { border-color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.staging-item .si-new { flex: 0 0 auto; font-size: 9.5px; font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase; color: #fff; background: var(--accent);
  padding: 1px 6px; border-radius: 999px; line-height: 1.6; }
.staging-item .si-icon { flex: 0 0 auto; font-size: 13px; line-height: 1; }
.staging-item .si-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--text); cursor: pointer; font-weight: 600; }
.staging-item .si-name:hover { color: var(--accent); text-decoration: underline; }
.staging-item .si-grip { flex: 0 0 auto; color: var(--text-muted); cursor: grab; opacity: .6; font-size: 13px; }
.staging-item .si-del { flex: 0 0 auto; border: 0; background: none; color: var(--text-muted);
  cursor: pointer; font-size: 16px; line-height: 1; border-radius: 5px; padding: 0 6px; }
.staging-item .si-del:hover { color: #b42318; background: #fdeceb; }
.staging-hint, .staging-empty { font-size: 12px; margin: 8px 2px 0; line-height: 1.5; }
/* staging view page bits */
.staging-badge { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent); border-radius: 999px; padding: 1px 9px; }
.staging-note { margin: 4px 0 18px; padding: 10px 12px; font-size: 13px; border-radius: 8px;
  background: var(--accent-soft); border: 1px solid var(--border-muted); }
.drop-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(9, 105, 218, 0.12);
  display: grid; place-items: center; pointer-events: none; }
.drop-overlay-inner { padding: 28px 40px; border: 2.5px dashed var(--accent); border-radius: 14px;
  background: var(--bg); color: var(--accent); font-size: 18px; font-weight: 600; box-shadow: var(--shadow); }

/* nested folder tree (sidebar): caret toggles, name links to folder view */
.tree-dir-row { display: flex; align-items: center; }
.tree-toggle { width: auto; flex: 0 0 auto; padding: 5px 2px 5px 6px; }
.tree-dir-link { flex: 1; min-width: 0; display: block; padding: 5px 8px 5px 2px;
  border-radius: 6px; color: var(--text); font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-dir-link:hover { background: var(--bg-elev); text-decoration: none; }
.tree-dir.is-collapsed > .tree-dir-row .tree-caret { transform: rotate(0deg); }
.tree-dir-row { cursor: default; }
.tree-dir-row .tree-dir-link { cursor: pointer; }
/* active folder (currently viewed folder page) */
.tree-dir-row.is-active > .tree-dir-link {
  background: var(--accent-soft); color: var(--text); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}
/* keyboard/mouse selection cursor (Explorer-like), distinct from active */
.tree-file.is-selected > a,
.tree-dir-row.is-selected > .tree-dir-link {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 6px;
}
.tree-dir-link:focus, .tree-file > a:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

/* folder browse page (drill-down) */
.browse-list { list-style: none; margin: 18px 0 24px; padding: 0;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.browse-list li + li .browse-item { border-top: 1px solid var(--border-muted); }
.browse-item { display: flex; align-items: center; gap: 11px; padding: 11px 14px; color: var(--text); }
.browse-item:hover { background: var(--bg-elev); text-decoration: none; }
.bi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browse-dir .bi-name { font-weight: 600; }
.bi-meta { font-size: 12px; color: var(--text-muted); }
.bi-chev { color: var(--text-muted); font-size: 18px; line-height: 1; }
.bi-icon { flex: 0 0 auto; display: inline-block; position: relative; }
.browse-dir .bi-icon { width: 18px; height: 14px; background: var(--accent); border-radius: 0 2px 2px 2px; opacity: .9; }
.browse-dir .bi-icon::before { content: ""; position: absolute; top: -3px; left: 0; width: 8px; height: 3px;
  background: var(--accent); border-radius: 2px 2px 0 0; opacity: .9; }
.browse-file .bi-icon { width: 12px; height: 15px; border: 1.5px solid var(--text-muted); border-radius: 2px; }
.folder-readme { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--border); }

/* sidebar drag-to-move documents */
.tree-file a[draggable="true"] { cursor: grab; }
.tree-file a.is-dragging { opacity: .45; }
.tree-dir.is-drop-over > .tree-dir-row { background: var(--accent-soft);
  outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.nav-tree.is-drop-root { outline: 2px dashed var(--accent); outline-offset: -4px; border-radius: 8px; }
.tree-hint { font-size: 11px; color: var(--text-muted); margin: 8px 8px 0; }

/* editor image insert */
.editor-hint { font-size: 12px; align-self: center; }
.editor-textarea.is-drop { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ===== UX pass: bigger editor + clearer grouped sidebar + bigger + ===== */

/* editor uses the FULL width: hide the project sidebar and the empty toc column */
.page-editor .layout { display: block; }
.page-editor .sidebar { display: none; }
.page-editor .col-resizer { display: none; }
.page-editor .content { padding: 0 24px; }
.editor-wrap { max-width: 1500px; }
.editor-textarea, .editor-preview { min-height: calc(100vh - 235px); }

/* sidebar: each section is a clearly separated group */
.sidebar { padding: 0 0 48px; }
.nav-companies, .nav-projects, .nav-tree {
  padding: 14px 12px; margin: 0; border-bottom: 1px solid var(--border);
}
.nav-tree { margin-top: 0; }
.nav-projects { background: var(--bg-elev); }          /* tint -> distinct from 회사 */

/* group headers: bigger, with an accent marker so they read as group titles */
.nav-section-title {
  font-size: 12.5px; text-transform: none; letter-spacing: 0;
  font-weight: 700; color: var(--text-muted);
  margin: 0 2px 10px; padding: 0;
  display: flex; align-items: center; gap: 7px;
}
.nav-section-title::before {
  content: ""; flex: 0 0 auto; width: 4px; height: 14px;
  border-radius: 2px; background: var(--accent);
}

/* bigger, clearer list items + strong active state */
.project-list a { padding: 9px 10px; font-size: 14.5px; border-radius: 8px; }
.project-list .is-active > a {
  background: var(--accent-soft); color: var(--text); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}
.project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* bigger + button (chip) */
.mini-add {
  float: none; margin-left: auto;
  width: 24px; height: 24px; display: inline-grid; place-items: center;
  border-radius: 7px; background: var(--accent-soft); color: var(--accent);
  font-size: 17px; font-weight: 700; line-height: 1;
}
.mini-add:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* company accordion (click the open company again to collapse its projects) */
.co-item { list-style: none; }
.co-row { display: flex; align-items: center; gap: 2px; }
.co-row .co-link { flex: 1 1 auto; min-width: 0; }
.co-toggle {
  flex: 0 0 auto; width: 24px; height: 32px;
  display: grid; place-items: center;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--text-muted);
}
.co-toggle:hover { color: var(--accent); }
.co-toggle--ph { cursor: default; }
.co-item:not(.is-open) .co-toggle .tree-caret { transform: rotate(0deg); }   /* ▶ closed */
.co-item.is-open .co-toggle .tree-caret { transform: rotate(90deg); }        /* ▼ open */
.co-item.is-active > .co-row > .co-link {
  background: var(--accent-soft); color: var(--text); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}
.co-projects { margin: 2px 0 6px; padding-left: 16px; border-left: 1px solid var(--border-muted); margin-left: 13px; }
.co-item:not(.is-open) .co-projects { display: none; }
.mini-add-row {
  display: block; padding: 7px 10px; font-size: 13.5px; font-weight: 600;
  color: var(--accent); border-radius: 8px;
}
.mini-add-row:hover { background: var(--accent-soft); text-decoration: none; }

/* sidebar manage actions as chips */
.tree-manage { gap: 8px; margin-top: 12px; }
.tree-manage > a {
  display: inline-block; padding: 6px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--accent);
}
.tree-manage > a:hover { border-color: var(--accent); text-decoration: none; }
.tree-manage > a.danger { color: #d1242f; }
.tree-hint { margin: 10px 2px 0; }

/* swap editor / preview positions */
.editor-panes.is-swapped .editor-textarea { order: 2; }
.editor-panes.is-swapped .editor-preview { order: 1; }

/* ===== search highlight + favorites + home quick lists ===== */
mark { background: var(--accent-soft); color: inherit; padding: 0 2px; border-radius: 3px; }
.hit-path { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.hit-path .sep { opacity: .5; }
.hit-file { color: var(--text); font-weight: 600; }
.hit-line { color: var(--text-muted); }

.star-btn { background: none; border: none; cursor: pointer; font-size: 18px; line-height: 1;
  color: var(--border); padding: 0 4px; }
.star-btn:hover, .star-btn.is-on { color: #e3b341; }

.home-section { margin: 8px 0 22px; }
.home-h { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.home-h-mark { color: #e3b341; }
.quicklist { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.quicklist a { display: block; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text); }
.quicklist a:hover { border-color: var(--accent); text-decoration: none; }
.ql-title { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ql-path { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* reorder + folder drag */
.bi-grip { color: var(--text-muted); cursor: grab; opacity: .55; font-size: 14px; flex: 0 0 auto; }
.bi-grip:active { cursor: grabbing; }
.browse-list li.reordering { opacity: .4; }
.reorder-hint { font-size: 12px; margin: 0 0 8px; }

/* print / save-as-PDF: show only the document content */
@media print {
  .topbar, .sidebar, .toc, .breadcrumbs, .doc-actions, .tree-manage,
  .theme-toggle, .user-menu, .drop-overlay, .dz-result, .col-resizer { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; }
  .doc-wrap { max-width: none; margin: 0; padding: 0; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: none; }
  .diagram, pre, table, img, .markdown-body h1, .markdown-body h2 { page-break-inside: avoid; }
}
