/* Reek Wiki — same tokens as the customer panel and reek.ftp: plain near-black
   surfaces, thin borders, lime only for actions and the current item. */

@font-face { font-family: 'Exo 2'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/exo2-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Exo 2'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/exo2-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --bg: #0b0b0b;
    --bar: #101010;
    --card: #111111;
    --card-2: #161616;
    --border: #292929;
    --line: rgba(255, 255, 255, 0.08);
    --green: #a3e635;
    --green-hover: #b6ee55;
    --text: #e5e5e5;
    --muted: #a3a3a3;
    --faint: #737373;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 80px; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: var(--mono); }
.ico { width: 18px; height: 18px; flex-shrink: 0; }
.muted { color: var(--faint); font-size: 13.5px; }
.empty { color: var(--faint); }

h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.2; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
h2 { color: #fff; }
.lead { margin: 0; color: var(--muted); font-size: 16px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding-top: 36px; padding-bottom: 72px; }

/* ---- Top bar --------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--bar); border-bottom: 1px solid var(--line); }
.topbar-row { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.logo { height: 24px; width: auto; display: block; }
.brand-name { padding-left: 12px; border-left: 1px solid var(--line); font-weight: 700; color: var(--muted); }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.04); text-decoration: none; }
.topnav a.is-active { color: var(--green); }
.topsearch { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; width: 280px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); color: var(--faint); }
.topsearch:focus-within { border-color: rgba(163, 230, 53, 0.6); }
.topsearch input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #fff; font: inherit; font-size: 14px; }
.topbar-panel { flex-shrink: 0; }

/* ---- Buttons --------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 15px; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-size: 14px; font-weight: 700; line-height: 1.2;
    cursor: pointer; white-space: nowrap; transition: background-color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--green); color: #0b0b0b; }
.btn-primary:hover { background: var(--green-hover); color: #0b0b0b; }
.btn-ghost { background: #191919; border-color: #303030; color: var(--text); }
.btn-ghost:hover { background: #222; color: #fff; }

/* ---- Cards ----------------------------------------------------------- */
.card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; color: inherit; }
a.card:hover { border-color: #3a3a3a; text-decoration: none; }
.icon-box { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: rgba(163, 230, 53, 0.1); color: var(--green); }
.icon-box .ico { width: 20px; height: 20px; }

/* ---- Home ------------------------------------------------------------ */
.intro { max-width: 640px; margin-bottom: 36px; }
.search-big { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding: 6px 6px 6px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); color: var(--faint); }
.search-big:focus-within { border-color: rgba(163, 230, 53, 0.6); }
.search-big input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #fff; font: inherit; font-size: 16px; padding: 6px 0; }

.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cat-head { display: flex; gap: 12px; align-items: flex-start; color: inherit; }
.cat-head:hover { text-decoration: none; }
.cat-head:hover .cat-name { color: var(--green); }
.cat-name { display: block; font-size: 17px; font-weight: 700; color: #fff; }
.cat-desc { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.link-list { list-style: none; margin: 16px 0 0; padding: 0; }
.link-list li { border-top: 1px solid var(--line); }
.link-list a { display: block; padding: 8px 0; color: var(--text); font-size: 14.5px; }
.link-list a:hover { color: var(--green); text-decoration: none; }
.more { display: inline-block; margin-top: 10px; font-size: 13.5px; font-weight: 600; }

.home-blog { margin-top: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 20px; }
.section-head a { font-size: 14px; font-weight: 600; }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.post-card { display: flex; flex-direction: column; gap: 6px; }
.post-cover { width: calc(100% + 40px); margin: -20px -20px 8px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px 12px 0 0; display: block; background: var(--card-2); }
.post-meta { font-size: 13px; color: var(--faint); }
.post-title { font-size: 17px; font-weight: 700; color: #fff; line-height: 1.35; }
.post-card:hover .post-title { color: var(--green); }
.post-excerpt { font-size: 14px; color: var(--muted); }

.page-head { max-width: 720px; margin-bottom: 28px; }
.pages { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 32px; }

/* ---- Docs layout ----------------------------------------------------- */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; align-items: start; }
.docs.has-toc { grid-template-columns: 250px minmax(0, 1fr) 200px; }
.docs-main { min-width: 0; max-width: 760px; }

.sidebar { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 14px; }
.sidebar-toggle { display: none; }
.side-group + .side-group { margin-top: 18px; }
.side-cat { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-weight: 700; color: #fff; }
.side-cat:hover { color: var(--green); text-decoration: none; }
.side-cat.is-active { color: var(--green); }
.side-cat .ico { width: 16px; height: 16px; color: var(--faint); }
.sidebar ul { list-style: none; margin: 4px 0 0; padding: 0 0 0 7px; border-left: 1px solid var(--line); }
.sidebar li a { display: block; margin-left: -1px; padding: 5px 0 5px 16px; border-left: 2px solid transparent; color: var(--muted); }
.sidebar li a:hover { color: #fff; text-decoration: none; }
.sidebar li a.is-active { color: var(--green); border-left-color: var(--green); font-weight: 600; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; font-size: 13.5px; color: var(--faint); }
.crumbs a { color: var(--muted); }

.cat-title { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px; }
.cat-title .icon-box { margin-top: 4px; }
.page-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.page-list li + li { border-top: 1px solid var(--line); }
.page-list a { display: block; padding: 14px 18px; color: inherit; }
.page-list a:hover { background: rgba(255, 255, 255, 0.02); text-decoration: none; }
.page-list a:hover .page-list-title { color: var(--green); }
.page-list-title { display: block; font-weight: 700; color: #fff; }
.page-list-desc { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }

.toc { position: sticky; top: 84px; font-size: 13.5px; }
.toc-title { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li a { display: block; padding: 4px 0; color: var(--muted); }
.toc li a:hover { color: #fff; text-decoration: none; }
.toc li.is-sub a { padding-left: 12px; font-size: 13px; }

.article-head { margin-bottom: 24px; }
.cover { display: block; width: 100%; margin-bottom: 28px; border-radius: 12px; border: 1px solid var(--border); }
.article-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.pager a { display: flex; flex-direction: column; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; color: #fff; font-weight: 600; }
.pager a:hover { border-color: #3a3a3a; text-decoration: none; }
.pager-next { grid-column: 2; text-align: right; }

.post { max-width: 760px; margin: 0 auto; }
.post + .home-blog { max-width: 1200px; }

/* ---- Article text and blocks ------------------------------------------ */
.prose { font-size: 16px; line-height: 1.7; }
.prose > * + * { margin-top: 18px; }
.prose h2 { margin: 40px 0 0; font-size: 23px; line-height: 1.3; }
.prose h3 { margin: 28px 0 0; font-size: 18px; line-height: 1.35; color: #fff; }
.prose p { margin: 0; }
.prose .b-text > * + * { margin-top: 14px; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose blockquote { margin: 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--border); color: var(--muted); }
.prose :not(pre) > code { padding: 1px 6px; border-radius: 6px; background: var(--card-2); border: 1px solid var(--border); font-size: 0.88em; color: #fff; }
.prose pre { margin: 0; padding: 14px 16px; overflow-x: auto; border-radius: 10px; background: #0e0e0e; border: 1px solid var(--border); font-size: 13.5px; line-height: 1.6; color: #e5e5e5; }
.prose strong { color: #fff; }
.prose mark, .results mark { background: rgba(163, 230, 53, 0.22); color: #fff; border-radius: 3px; padding: 0 2px; }

.b-image { margin: 0; }
.b-image img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); }
.b-image.is-small { max-width: 420px; margin-left: auto; margin-right: auto; }
.b-image figcaption, .b-video figcaption { margin-top: 8px; font-size: 13.5px; color: var(--faint); text-align: center; }

.b-callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; border: 1px solid; font-size: 15px; }
.b-callout > .ico { margin-top: 3px; }
.b-callout > div > * + * { margin-top: 8px; }
.b-callout-title { display: block; color: #fff; }
.b-callout.is-info { background: rgba(56, 189, 248, 0.06); border-color: rgba(56, 189, 248, 0.25); }
.b-callout.is-info > .ico { color: #38bdf8; }
.b-callout.is-tip { background: rgba(163, 230, 53, 0.06); border-color: rgba(163, 230, 53, 0.25); }
.b-callout.is-tip > .ico { color: var(--green); }
.b-callout.is-warning { background: rgba(245, 158, 11, 0.07); border-color: rgba(245, 158, 11, 0.3); }
.b-callout.is-warning > .ico { color: #f59e0b; }
.b-callout.is-danger { background: rgba(239, 68, 68, 0.07); border-color: rgba(239, 68, 68, 0.3); }
.b-callout.is-danger > .ico { color: #f87171; }

.b-steps { list-style: none; counter-reset: step; padding: 0 !important; }
.b-steps > li { position: relative; counter-increment: step; padding: 0 0 18px 46px; }
.b-steps > li + li { margin-top: 0; }
.b-steps > li::before {
    content: counter(step); position: absolute; left: 0; top: 0;
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--card-2); border: 1px solid var(--border);
    font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--green);
}
.b-steps > li:not(:last-child)::after { content: ''; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 1px; background: var(--line); }
.b-step-title { display: block; padding-top: 3px; color: #fff; }
.b-step-body { margin-top: 6px; }
.b-step-body > * + * { margin-top: 10px; }

.b-code { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #0e0e0e; }
.b-code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--faint); }
.b-code-copy { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: #191919; color: var(--muted); font: inherit; cursor: pointer; }
.b-code-copy:hover { color: #fff; background: #222; }
.b-code pre { border: 0; border-radius: 0; }

.b-faq details { border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.b-faq details + details { margin-top: 8px; }
.b-faq summary { padding: 12px 16px; cursor: pointer; font-weight: 700; color: #fff; }
.b-faq summary:hover { color: var(--green); }
.b-faq-answer { padding: 0 16px 14px; }
.b-faq-answer > * + * { margin-top: 10px; }

.b-video { margin: 0; }
.b-video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #000; }
.b-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.b-divider { border: 0; border-top: 1px solid var(--line); margin: 32px 0 !important; }

/* ---- Search ---------------------------------------------------------- */
.results { list-style: none; margin: 12px 0 0; padding: 0; max-width: 760px; }
.results li + li { margin-top: 10px; }
.results a { display: block; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: inherit; }
.results a:hover { border-color: #3a3a3a; text-decoration: none; }
.result-kind { display: block; font-size: 12.5px; color: var(--faint); }
.result-title { display: block; font-size: 17px; font-weight: 700; color: #fff; }
.result-snippet { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }

/* ---- Admin bar (signed-in admins only) -------------------------------- */
.admin-bar { background: #141414; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.admin-bar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; }
.admin-bar-who { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.admin-bar-who .ico { width: 16px; height: 16px; color: var(--green); }
.admin-bar-off { color: #fbbf24; }
.admin-bar-off a { color: #fbbf24; font-weight: 700; text-decoration: underline; }
.admin-bar-actions { display: flex; gap: 8px; margin-left: auto; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-sm .ico { width: 15px; height: 15px; }

/* ---- Preview banner, errors, footer ---------------------------------- */
.preview-banner { background: rgba(245, 158, 11, 0.12); border-bottom: 1px solid rgba(245, 158, 11, 0.35); color: #fbbf24; font-size: 14px; }
.preview-banner .wrap { padding-top: 10px; padding-bottom: 10px; }
.error-page { max-width: 560px; margin: 40px auto; text-align: center; }
.error-page .search-big { text-align: left; }
.offline { margin-top: 64px; }
.offline .icon-box { width: 48px; height: 48px; margin-bottom: 16px; }
.offline .icon-box .ico { width: 24px; height: 24px; }
.offline .lead { margin-top: 8px; }
.offline-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.error-code { margin: 0; font-family: var(--mono); font-size: 14px; color: var(--faint); }
.footer { border-top: 1px solid var(--line); background: var(--bar); font-size: 13.5px; color: var(--faint); }
.footer-row { display: flex; flex-wrap: wrap; gap: 20px; padding-top: 18px; padding-bottom: 18px; }
.footer a { color: var(--muted); }

/* ---- Smaller screens ------------------------------------------------- */
@media (max-width: 1180px) {
    .docs.has-toc { grid-template-columns: 230px minmax(0, 1fr); }
    .toc { display: none; }
}
@media (max-width: 959px) {
    .docs, .docs.has-toc { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .sidebar { position: static; max-height: none; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
    .sidebar-toggle { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; font-weight: 700; color: #fff; list-style: none; }
    .sidebar-toggle::-webkit-details-marker { display: none; }
    .sidebar nav { padding: 0 16px 16px; }
    .cat-grid, .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topsearch { width: 200px; }
}
@media (max-width: 680px) {
    .wrap { padding: 0 16px; }
    .main { padding-top: 24px; }
    h1 { font-size: 25px; }
    .topbar-row { gap: 12px; }
    .topbar-panel, .brand-name { display: none; }
    .topsearch { width: auto; flex: 1; min-width: 0; padding: 0 10px; }
    .topsearch input::placeholder { color: transparent; }
    .topnav a { padding: 6px 6px; }
    .cat-grid, .post-grid { grid-template-columns: minmax(0, 1fr); }
    .search-big .btn { padding: 9px 12px; }
    .pager { grid-template-columns: minmax(0, 1fr); }
    .pager-next { grid-column: 1; }
}
