:root {
  --ink: #10251e;
  --ink-soft: #466057;
  --line: #d8ded8;
  --paper: #f7f7f2;
  --panel: #ffffff;
  --accent: #d4663b;
  --accent-dark: #a84425;
  --shadow: 0 16px 50px rgba(25, 47, 39, .09);
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100vh; margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.site-header { border-bottom: 1px solid var(--line); background: rgba(247, 247, 242, .88); backdrop-filter: blur(12px); }
.site-header__inner { width: min(1120px, calc(100% - 40px)); height: 72px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.brand__mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--ink); color: #f7f7f2; font: 700 16px/1 ui-sans-serif, system-ui, sans-serif; }
.back-link { color: var(--ink-soft); font-size: 14px; font-weight: 650; }
.back-link:hover { color: var(--accent-dark); }

.library, .document-shell { width: min(1120px, calc(100% - 40px)); margin: auto; }
.library { padding: 88px 0 104px; }
.library-intro { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 38px; }
.eyebrow { margin: 0 0 14px; color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
h1 { max-width: 760px; margin: 0; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(44px, 6vw, 76px); line-height: .98; letter-spacing: -.055em; }
.library-intro h1 + p, .empty-library > p:not(.eyebrow) { max-width: 530px; margin: 20px 0 0; color: var(--ink-soft); font-size: 18px; line-height: 1.65; }
.library-count { min-width: 114px; padding: 18px 0 7px 22px; border-left: 1px solid var(--line); color: var(--ink-soft); }
.library-count strong { display: block; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 38px; line-height: 1; }
.library-count span { font-size: 13px; }

.search-box { width: 100%; min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 5px 20px rgba(25, 47, 39, .04); color: var(--ink-soft); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(212, 102, 59, .13); }
.search-box > span { font-size: 24px; line-height: 0; transform: rotate(-20deg); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box input::placeholder { color: #95a59d; }
.search-box kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: #84958d; font-size: 11px; }
.search-result { min-height: 22px; margin: 11px 2px 0; color: var(--ink-soft); font-size: 13px; }

.collections { margin-top: 34px; }
.collection { padding: 27px 0 34px; border-top: 1px solid var(--line); }
.collection__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.collection__heading p { margin: 0; color: var(--ink); font-size: 15px; font-weight: 750; }
.collection__heading span { color: var(--ink-soft); font-size: 13px; }
.file-tree { padding: 4px 0 0; }
.tree-directory { position: relative; margin-left: 4px; border-left: 1px solid #dbe2db; }
.tree-directory > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 10px 9px 16px; cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 720; list-style: none; user-select: none; }
.tree-directory > summary::-webkit-details-marker { display: none; }
.tree-directory > summary span { display: inline-flex; align-items: center; gap: 8px; }
.tree-directory > summary i { color: var(--accent); font-style: normal; transform: rotate(-90deg); transition: transform .16s ease; }
.tree-directory[open] > summary i { transform: rotate(0); }
.tree-directory > summary small { color: var(--ink-soft); font-size: 12px; font-weight: 500; }
.tree-directory > summary:hover { background: #eef2ee; }
.tree-children { margin-left: 18px; }
.tree-file { min-width: 0; display: flex; align-items: center; gap: 13px; margin-left: 4px; padding: 10px 10px 10px 16px; border-left: 1px solid #dbe2db; border-radius: 0 8px 8px 0; color: var(--ink); font-size: 14px; transition: background .16s ease, color .16s ease; }
.tree-file:hover { background: var(--panel); color: var(--accent-dark); box-shadow: 0 5px 15px rgba(25, 47, 39, .05); }
.tree-file > span:nth-child(2) { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.tree-file > i { color: var(--accent); font-size: 18px; font-style: normal; opacity: 0; transform: translateX(-3px); transition: opacity .16s ease, transform .16s ease; }
.tree-file:hover > i { opacity: 1; transform: translateX(0); }
.file-badge { flex: none; min-width: 43px; padding: 5px 7px; border-radius: 6px; background: #e7eee9; color: #426054; font-size: 10px; font-weight: 850; letter-spacing: .05em; text-align: center; }
.tree-file[hidden], .tree-directory[hidden], .collection[hidden] { display: none; }

.empty-library { max-width: 760px; padding-top: 104px; }
.empty-state { display: flex; gap: 17px; align-items: flex-start; margin-top: 42px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.empty-state__mark { width: 32px; height: 32px; display: grid; flex: none; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 21px; }
.empty-state strong { font-size: 15px; }
.empty-state p { margin: 5px 0 0; color: var(--ink-soft); line-height: 1.55; }
.empty-state code { padding: 2px 5px; border-radius: 4px; background: #edf1ed; color: #324d40; font-size: .9em; }

.document-shell { max-width: 860px; padding: 72px 0 110px; }
.document-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 22px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; }
.prose { margin-top: 40px; color: #1e342a; font-size: 17px; line-height: 1.82; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--ink); font-family: Georgia, "Times New Roman", serif; line-height: 1.16; letter-spacing: -.035em; }
.prose h1 { margin: 0 0 30px; font-size: clamp(38px, 5vw, 58px); }
.prose h2 { margin: 52px 0 16px; font-size: 31px; }
.prose h3 { margin: 36px 0 12px; font-size: 23px; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 22px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--accent-dark); text-decoration: underline; text-decoration-color: #d4663b75; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); }
.prose blockquote { padding: 8px 0 8px 22px; border-left: 3px solid var(--accent); color: #536b60; }
.prose pre { overflow: auto; margin: 26px 0; padding: 18px 20px; border-radius: 12px; background: #14261f; color: #edf4ee; box-shadow: var(--shadow); }
.prose code { padding: 2px 5px; border-radius: 4px; background: #e9efea; color: #244235; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .87em; }
.prose pre code { padding: 0; background: transparent; color: inherit; }
.prose img { display: block; max-width: 100%; height: auto; margin: 28px 0; border: 1px solid var(--line); border-radius: 10px; }
.prose table { width: 100%; display: block; overflow: auto; margin: 28px 0; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.prose th { background: #edf2ed; }

.site-footer { width: min(1120px, calc(100% - 40px)); display: flex; gap: 8px; margin: auto; padding: 22px 0 30px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; }
.site-footer a:hover { color: var(--accent-dark); }

@media (max-width: 680px) {
  .site-header__inner, .library, .document-shell, .site-footer { width: min(100% - 32px, 1120px); }
  .site-header__inner { height: 64px; }
  .library { padding: 60px 0 76px; }
  .library-intro { display: block; margin-bottom: 29px; }
  .library-count { display: none; }
  h1 { font-size: 48px; }
  .tree-children { margin-left: 12px; }
  .document-shell { padding: 48px 0 80px; }
  .prose { margin-top: 30px; font-size: 16px; }
  .prose h2 { font-size: 27px; }
}
