:root {
  color-scheme: dark;
  --bg: #151517;
  --panel: rgba(31, 31, 35, .86);
  --panel-solid: #202024;
  --line: rgba(255, 255, 255, .09);
  --text: #f3f1f2;
  --muted: #aaa4a8;
  --accent: #ff8dac;
  --accent-soft: rgba(255, 141, 172, .13);
  --danger: #ff8d8d;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background: radial-gradient(circle at 70% 10%, #31252b 0, transparent 34%), var(--bg); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.ambient { position: fixed; z-index: 0; border-radius: 999px; filter: blur(80px); opacity: .22; pointer-events: none; }
.ambient-one { width: 360px; height: 360px; background: #bb3f65; top: -190px; right: -90px; }
.ambient-two { width: 280px; height: 280px; background: #80515f; bottom: -180px; left: -100px; }

.unlock-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 28px; }
.unlock-card { min-width: 0; width: min(100%, 820px); display: grid; grid-template-columns: 1.05fr .95fr; border: 1px solid var(--line); border-radius: 26px; background: var(--panel); box-shadow: 0 34px 90px rgba(0,0,0,.38); overflow: hidden; backdrop-filter: blur(18px); }
.unlock-brand { min-height: 470px; display: flex; flex-direction: column; justify-content: space-between; padding: 38px 42px; background: linear-gradient(150deg, rgba(255,141,172,.15), rgba(255,255,255,.015) 58%); border-right: 1px solid var(--line); }
.back-link { display: inline-block; align-self: flex-start; color: var(--muted); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--text); }
.brand-copy { padding-bottom: 10px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 28px; border: 1px solid rgba(255,141,172,.38); border-radius: 12px; color: var(--accent); background: rgba(255,141,172,.09); font-size: 13px; font-weight: 850; letter-spacing: .08em; }
.brand-kicker { margin: 0 0 12px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(38px, 5vw, 58px); line-height: .98; letter-spacing: -.055em; overflow-wrap: anywhere; }
.topic-line { margin: 24px 0 0; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .12em; line-height: 1.7; }
.unlock-panel { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 48px 42px; }
.unlock-panel h2 { margin: 0; font-size: 27px; letter-spacing: -.03em; }
label { display: block; margin: 46px 0 9px; font-size: 14px; font-weight: 700; }
.password-row { display: flex; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.18); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.password-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.password-row input { min-width: 0; flex: 1; padding: 14px 15px; border: 0; outline: 0; color: var(--text); background: transparent; }
.password-row button { width: 46px; display: grid; place-items: center; border: 0; padding: 0; color: var(--muted); background: transparent; cursor: pointer; }
.password-row button:hover { color: var(--text); }
.password-row svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.remember-row { display: inline-flex; align-items: center; gap: 9px; margin: 13px 0 0; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.remember-row input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.primary-button { width: 100%; margin-top: 18px; padding: 14px; border: 0; border-radius: 13px; color: #29181e; background: linear-gradient(135deg, #ffb3c8, #ff789d); font-weight: 800; cursor: pointer; }
.primary-button:hover { filter: brightness(1.04); }
.primary-button:disabled { cursor: wait; opacity: .66; }
.status { min-height: 24px; margin: 14px 0 0; color: var(--danger); font-size: 14px; }

.app-shell { position: relative; z-index: 1; min-height: 100vh; }
.app-header { position: sticky; top: 0; z-index: 20; height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(21,21,23,.88); backdrop-filter: blur(18px); }
.brand { text-decoration: none; font-size: 20px; font-weight: 850; letter-spacing: -.03em; }
.brand span { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.search-button, .text-button { min-height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(255,255,255,.035); text-decoration: none; cursor: pointer; }
.search-button { display: inline-flex; align-items: center; gap: 13px; padding: 0 9px 0 13px; }
.search-button kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: rgba(0,0,0,.18); font: 10px/1 ui-monospace, monospace; }
.text-button { display: inline-flex; align-items: center; padding: 0 13px; font-size: 14px; }
.workspace { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { position: sticky; top: 68px; align-self: start; height: calc(100vh - 68px); padding: 26px 18px; border-right: 1px solid var(--line); overflow: auto; }
.sidebar-heading { display: flex; justify-content: space-between; padding: 0 10px 16px; color: var(--muted); font-size: 13px; }
.sidebar-heading strong { color: var(--text); }
.feature-nav { display: grid; gap: 5px; margin-bottom: 17px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.feature-link { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.feature-link span:last-child { color: var(--accent); font-size: 12px; }
.feature-link:hover, .feature-link.active { color: var(--text); border-color: rgba(255,141,172,.18); background: var(--accent-soft); }
.category-link { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 3px 0; padding: 10px 11px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.category-link:hover, .category-link.active { color: var(--text); background: var(--accent-soft); }
.category-link span:last-child { font-size: 12px; opacity: .65; }
.content { width: min(100%, 1120px); margin: 0 auto; padding: 50px clamp(24px, 5vw, 72px) 90px; outline: none; }
.hero { padding: 24px 0 36px; }
.hero h1 { max-width: 760px; }
.hero p { max-width: 720px; color: var(--muted); line-height: 1.8; }
.knowledge-stats { display: flex; gap: 34px; margin-top: 28px; }
.knowledge-stats div { display: grid; gap: 4px; }
.knowledge-stats strong { font-size: 18px; font-weight: 750; }
.knowledge-stats span { color: var(--muted); font-size: 11px; letter-spacing: .05em; }
.category-grid, .document-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.category-card, .document-card { display: block; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-decoration: none; transition: transform .2s, border-color .2s; }
.category-card { min-height: 110px; }
.document-card { min-height: 155px; }
.category-card:hover, .document-card:hover { transform: translateY(-2px); border-color: rgba(255,141,172,.42); }
.category-card strong, .document-card strong { display: block; margin: 12px 0 8px; font-size: 18px; }
.category-card p, .document-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.count-badge, .tag { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 750; }
.section-title { margin: 42px 0 17px; font-size: 20px; }
.doc-header { padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; color: var(--muted); font-size: 13px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.doc-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; color: var(--muted); font-size: 13px; }
.article { max-width: 850px; padding-top: 20px; color: #ddd9dc; font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.article h1, .article h2, .article h3, .article h4 { color: var(--text); line-height: 1.35; letter-spacing: -.02em; scroll-margin-top: 90px; }
.article h1 { font-size: 2rem; margin-top: 2.4rem; }
.article h2 { margin-top: 2.3rem; padding-bottom: .45rem; border-bottom: 1px solid var(--line); font-size: 1.65rem; }
.article h3 { margin-top: 1.9rem; font-size: 1.3rem; }
.article a { color: #ff9eba; }
.article img { max-width: 100%; border-radius: 14px; }
.article blockquote { margin: 1.5em 0; padding: 2px 18px; border-left: 3px solid var(--accent); color: var(--muted); background: rgba(255,255,255,.025); }
.article code { padding: .16em .38em; border-radius: 5px; color: #ffb2c7; background: #29262a; }
.code-shell { position: relative; margin: 1.5em 0; }
.article .code-shell pre { margin: 0; padding: 46px 18px 18px; border: 1px solid var(--line); border-radius: 13px; background: #111113; overflow: auto; }
.article pre code { padding: 0; color: #e7e2e5; background: transparent; }
.copy-code { position: absolute; z-index: 2; top: 9px; right: 9px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #252328; font-size: 12px; cursor: pointer; }
.copy-code:hover { color: var(--text); border-color: rgba(255,141,172,.42); }
.article table { display: block; width: max-content; max-width: 100%; border-collapse: collapse; overflow: auto; }
.article th, .article td { padding: 8px 12px; border: 1px solid var(--line); }
.unavailable-link { text-decoration: line-through; opacity: .65; }
.related-section { max-width: 850px; margin-top: 58px; padding-top: 30px; border-top: 1px solid var(--line); }
.related-section .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.related-section .document-card { min-height: 130px; }

.vault-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 10px; margin: 4px 0 24px; }
.vault-toolbar.file-toolbar { grid-template-columns: 1fr; }
.vault-toolbar input, .vault-toolbar select { min-width: 0; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--text); background: #1b1b1e; }
.vault-toolbar input:focus, .vault-toolbar select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.snippet-summary { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.snippet-grid { display: grid; gap: 12px; }
.snippet-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.snippet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.snippet-source { min-width: 0; color: var(--muted); font-size: 12px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snippet-source:hover { color: var(--text); }
.snippet-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.snippet-language { color: var(--accent); font: 11px/1 ui-monospace, monospace; text-transform: uppercase; }
.snippet-copy { padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: rgba(255,255,255,.03); font-size: 12px; cursor: pointer; }
.snippet-copy:hover { color: var(--text); border-color: rgba(255,141,172,.42); }
.snippet-card pre { max-height: 310px; margin: 0; padding: 16px; color: #e7e2e5; background: #111113; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; overflow: auto; white-space: pre; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.file-card { display: block; min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: var(--panel); text-decoration: none; }
.file-card:hover { border-color: rgba(255,141,172,.42); transform: translateY(-1px); }
.file-card strong { display: block; margin: 11px 0 7px; overflow-wrap: anywhere; }
.file-card small { display: block; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.file-viewer { margin-top: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.file-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.file-actions div { color: var(--muted); font-size: 12px; }
.file-actions button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: rgba(255,255,255,.04); cursor: pointer; }
.file-actions button:hover { border-color: rgba(255,141,172,.42); }
.file-content { max-height: 70vh; margin: 0; padding: 18px; color: #e7e2e5; background: #111113; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; overflow: auto; white-space: pre; }
.binary-file { padding: 50px 22px; color: var(--muted); text-align: center; }

.search-dialog { width: min(720px, calc(100% - 28px)); margin-top: 10vh; padding: 0; border: 1px solid var(--line); border-radius: 20px; color: var(--text); background: #222226; box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.search-dialog::backdrop { background: rgba(0,0,0,.66); backdrop-filter: blur(6px); }
.search-box { padding: 20px; }
.search-heading { display: flex; align-items: center; justify-content: space-between; }
.search-heading button { border: 0; color: var(--muted); background: transparent; font-size: 25px; cursor: pointer; }
.search-heading button:hover { color: var(--text); }
#search-input { width: 100%; margin: 10px 0 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--text); background: #171719; }
#search-input:focus { border-color: var(--accent); }
.search-results { max-height: 55vh; overflow: auto; }
.search-result { display: block; margin: 5px 0; padding: 13px; border-radius: 10px; text-decoration: none; }
.search-result:hover { background: var(--accent-soft); }
.search-result strong { display: block; }
.search-result span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.empty { padding: 40px 10px; color: var(--muted); text-align: center; }

@media (max-width: 760px) {
  .unlock-shell { padding: 16px; }
  .unlock-card { grid-template-columns: 1fr; border-radius: 21px; }
  .unlock-brand { min-height: 285px; padding: 25px 23px 29px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-copy { padding: 46px 0 0; }
  .brand-mark { width: 36px; height: 36px; margin-bottom: 20px; border-radius: 10px; }
  .brand-kicker { margin-bottom: 9px; }
  .topic-line { margin-top: 17px; font-size: 9px; }
  .unlock-panel { padding: 29px 23px 24px; }
  .unlock-panel h2 { font-size: 23px; }
  .unlock-panel label { margin-top: 28px; }
  .app-header { height: 60px; padding: 0 15px; }
  .brand { font-size: 17px; }
  .search-button { width: 39px; padding: 0; justify-content: center; }
  .search-button span { font-size: 0; }
  .search-button span::after { content: '⌕'; font-size: 22px; }
  .search-button kbd { display: none; }
  .workspace { display: block; min-height: calc(100vh - 60px); }
  .sidebar { position: static; height: auto; padding: 12px 13px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-heading { display: none; }
  .feature-nav { display: flex; gap: 6px; margin: 0 0 10px; padding: 0 0 10px; overflow-x: auto; }
  .feature-link { flex: 0 0 auto; width: auto; gap: 18px; padding: 8px 11px; }
  #category-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .category-link { flex: 0 0 auto; width: auto; padding: 8px 11px; }
  .category-link span:last-child { display: none; }
  .content { padding: 30px 19px 70px; }
  .hero { padding-top: 5px; }
  .knowledge-stats { gap: 22px; overflow-x: auto; }
  .knowledge-stats div:last-child { min-width: 92px; }
  .category-grid, .document-grid { grid-template-columns: 1fr; }
  .category-card, .document-card { min-height: 130px; }
  .related-section .document-grid { grid-template-columns: 1fr; }
  .vault-toolbar { grid-template-columns: 1fr; }
  .snippet-card pre { max-height: 260px; font-size: 12px; }
  .file-grid { grid-template-columns: 1fr; }
  .file-actions { align-items: flex-start; flex-direction: column; }
  .file-content { max-height: 62vh; font-size: 12px; }
  .text-button { padding: 0 10px; }
}
