/* STACKGee documentation portal. Builds on site.css tokens and components.
   No inline styles anywhere: the Content Security Policy forbids them. */

/* ---------- Search ---------- */
.docs-search { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; max-width: 420px; margin: 0; }
.docs-search input[type="search"] { flex: 1; min-width: 0; min-height: 46px; padding-left: 42px; padding-right: 40px; font-size: .98rem; }
.docs-search input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.docs-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; display: inline-flex; }
.docs-search-icon .icon { width: 18px; height: 18px; }
.docs-search-key { display: none; position: absolute; right: 104px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.js .docs-search-key { display: inline-flex; }
.docs-search input:focus ~ .docs-search-key, .docs-search input:not(:placeholder-shown) ~ .docs-search-key { display: none; }
.docs-search .btn { flex: none; min-height: 46px; }
.docs-search-lg { max-width: 640px; margin-top: 28px; }
.docs-search-lg input[type="search"] { min-height: 54px; font-size: 1.04rem; }
.docs-search-lg .btn { min-height: 54px; padding-inline: 22px; }
kbd { font-family: var(--mono); font-size: .78rem; font-weight: 600; line-height: 1; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: #fff; color: var(--muted); }
@media (max-width: 720px) { .js .docs-search-key { display: none; } }

/* ---------- Heads ---------- */
.docs-head { padding-block: clamp(32px, 5vw, 56px) clamp(28px, 4vw, 44px); }
.docs-head h1 { font-size: clamp(1.9rem, 1.35rem + 2vw, 2.7rem); max-width: 26ch; }
.docs-head .lead { max-width: 62ch; }
.docs-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 22px 40px; }
.docs-head-text { flex: 1 1 420px; min-width: 0; }
.docs-head-row .docs-search { flex: 0 1 380px; }
.docs-audience { margin-top: 18px; }
.docs-audience .chip { background: rgba(255, 255, 255, .85); }
.docs-hero h1 { max-width: none; }

/* ---------- Home ---------- */
.docs-product { border: 1px solid var(--line); border-radius: var(--radius-l); background: #fff; box-shadow: var(--shadow-1); padding: clamp(22px, 3vw, 36px); }
.docs-product-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 20px; align-items: start; padding-bottom: 22px; margin-bottom: 24px; border-bottom: 1px dashed var(--line); }
.docs-product-head .card-icon { margin: 0; }
.docs-product-head h2 { font-size: clamp(1.35rem, 1.1rem + .8vw, 1.7rem); margin-bottom: 6px; }
.docs-product-head h2 a { color: inherit; text-decoration: none; }
.docs-product-head h2 a:hover { color: var(--blue-700); }
.docs-product-head p { margin: 0; max-width: 70ch; }
@media (max-width: 720px) { .docs-product-head { grid-template-columns: auto minmax(0, 1fr); } .docs-product-head .btn { grid-column: 1 / -1; justify-self: start; } }
.docs-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px 28px; }
.docs-group-col h3 { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green-700); margin: 0 0 10px; }
.docs-link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.docs-link-list a { font-weight: 600; text-decoration: none; }
.docs-link-list a:hover { text-decoration: underline; }
.docs-platform-card { display: flex; flex-direction: column; }
.docs-platform-card .card-foot { margin-top: auto; flex-wrap: wrap; }
.docs-platform-card .card-foot > a:last-child:not(.link-arrow) { font-weight: 600; font-size: .92rem; }

/* ---------- Section index ---------- */
.docs-group + .docs-group { margin-top: clamp(36px, 5vw, 56px); }
.docs-group > h2 { font-size: clamp(1.3rem, 1.1rem + .7vw, 1.6rem); margin-bottom: 18px; }
.docs-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 20px); }
@media (max-width: 760px) { .docs-cards { grid-template-columns: 1fr; } }
.docs-card { display: flex; flex-direction: column; }
.docs-card h3 { font-size: 1.12rem; }
.docs-card p { color: var(--muted); font-size: .97rem; }
.docs-card .docs-audience { margin-top: auto; padding-top: 6px; }
.docs-card .chip { font-size: .78rem; padding: 3px 10px; background: var(--surface); }
.docs-section-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: clamp(36px, 5vw, 56px); padding-top: 24px; border-top: 1px solid var(--line); }
.docs-section-foot p { margin: 0; }

/* ---------- Guide layout ---------- */
.docs-layout {
  display: grid; grid-template-columns: 240px minmax(0, 1fr) 220px; grid-template-areas: "nav main toc";
  gap: 0 clamp(28px, 3.5vw, 48px); align-items: start; padding-block: clamp(28px, 4vw, 48px) clamp(56px, 7vw, 96px);
}
.docs-main { grid-area: main; min-width: 0; }
.docs-nav { grid-area: nav; }
.docs-toc { grid-area: toc; }
.docs-nav, .docs-toc { position: sticky; top: 96px; max-height: calc(100vh - 116px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
@media (max-width: 1180px) {
  .docs-layout { grid-template-columns: 230px minmax(0, 1fr); grid-template-areas: "nav toc" "nav main"; }
  .docs-toc { position: static; max-height: none; overflow: visible; margin-bottom: 28px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
}
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "toc" "main" "nav"; }
  .docs-nav { position: static; max-height: none; overflow: visible; margin-top: 40px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
}
.docs-aside-title { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.docs-aside-title a { color: inherit; text-decoration: none; }
.docs-aside-title a:hover { color: var(--blue-700); }

/* Section navigation */
.docs-nav ul { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 2px; }
.docs-nav-group { font-size: .78rem; font-weight: 700; color: var(--green-700); margin: 16px 0 6px; padding-left: 12px; }
.docs-nav-group:first-of-type { margin-top: 4px; }
.docs-nav a { display: block; padding: 7px 12px; border-radius: var(--radius-xs); color: var(--text); font-size: .92rem; font-weight: 600; line-height: 1.35; text-decoration: none; border-left: 3px solid transparent; }
.docs-nav a:hover { background: var(--surface); color: var(--blue-700); }
.docs-nav a[aria-current="page"] { background: var(--blue-50); color: var(--blue-800); border-left-color: var(--blue-500); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
@media (max-width: 860px) { .docs-nav a:hover { background: #fff; } }

/* On-page contents */
.docs-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.docs-toc ol ol { padding-left: 12px; margin-top: 2px; }
.docs-toc a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); color: var(--muted); font-size: .88rem; font-weight: 600; line-height: 1.4; text-decoration: none; }
.docs-toc ol ol a { font-size: .84rem; }
.docs-toc a:hover { color: var(--blue-700); border-left-color: var(--blue-300); }
.docs-toc a.is-active { color: var(--blue-800); border-left-color: var(--blue-500); }
@media (max-width: 1180px) { .docs-toc a { border-left: 0; padding-left: 0; } .docs-toc a.is-active { color: var(--muted); } }

/* ---------- Guide body ---------- */
.docs-prose { max-width: 72ch; }
.docs-prose > :first-child { margin-top: 0; }
.docs-prose h2, .docs-prose h3 { scroll-margin-top: 100px; }
.docs-prose h2:first-child { margin-top: 0; }
.docs-prose h2 { padding-top: .2em; }
.docs-prose li > p { margin-bottom: .4em; }
.docs-prose ol > li::marker { color: var(--blue-700); font-weight: 700; }
.docs-prose ul > li::marker { color: var(--blue-400); }
.docs-prose ol ol, .docs-prose ul ul, .docs-prose ol ul, .docs-prose ul ol { margin: .4em 0 .6em; }
.docs-prose dt { font-weight: 700; color: var(--ink); margin-top: .8em; }
.docs-prose dd { margin: .2em 0 .6em 1.2em; }
.docs-prose table { display: block; overflow-x: auto; }
.docs-prose [align="center"] { text-align: center; }
.docs-prose [align="right"] { text-align: right; }
.docs-prose a.anchor { margin-left: .35em; padding: 0 .15em; font-weight: 600; color: var(--line-strong); text-decoration: none; opacity: 0; transition: opacity .15s; }
.docs-prose :is(h2, h3, h4):hover a.anchor, .docs-prose a.anchor:focus-visible { opacity: 1; }
.docs-prose a.anchor:hover { color: var(--blue-600); }
@media (hover: none) { .docs-prose a.anchor { opacity: .6; } }

/* Admonitions: !!! note "Title" */
.docs-prose .admonition { margin: 0 0 1.3em; padding: 14px 18px; border: 1px solid var(--blue-200); border-left-width: 4px; border-radius: var(--radius-s); background: var(--blue-50); color: var(--blue-900); }
.docs-prose .admonition > :last-child { margin-bottom: 0; }
.docs-prose .admonition-title { font-weight: 700; color: var(--blue-800); margin-bottom: .35em; }
.docs-prose .admonition.tip { border-color: var(--green-200); background: var(--green-50); color: var(--green-800); }
.docs-prose .admonition.tip .admonition-title { color: var(--green-800); }
.docs-prose .admonition.warning, .docs-prose .admonition.caution, .docs-prose .admonition.important { border-color: #f2d48f; background: var(--amber-100); color: #5c3c00; }
.docs-prose .admonition.warning .admonition-title, .docs-prose .admonition.caution .admonition-title, .docs-prose .admonition.important .admonition-title { color: var(--amber-700); }
.docs-prose .admonition.danger { border-color: #f5b5b5; background: var(--red-100); color: var(--red-700); }
.docs-prose .admonition.danger .admonition-title { color: var(--red-700); }
.docs-prose .admonition code { background: rgba(255, 255, 255, .7); }

/* ---------- Guide footer ---------- */
.docs-foot { max-width: 72ch; margin-top: clamp(36px, 5vw, 56px); padding-top: 24px; border-top: 1px solid var(--line); }
.docs-foot .updated { margin-bottom: 22px; }
.docs-help { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 16px; align-items: start; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.docs-help .card-icon { margin: 0; }
.docs-help h2 { font-size: 1.05rem; margin: 2px 0 4px; }
.docs-help p { margin: 0; font-size: .96rem; }
.docs-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.docs-pager-link { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; text-decoration: none; transition: border-color .2s, box-shadow .2s; }
.docs-pager-link:hover { border-color: var(--blue-300); box-shadow: var(--shadow-2); }
.docs-pager-next { grid-column: 2; text-align: right; }
.docs-pager-label { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.docs-pager-title { font-weight: 700; color: var(--blue-700); line-height: 1.35; }
@media (max-width: 560px) { .docs-pager { grid-template-columns: 1fr; } .docs-pager-next { grid-column: auto; } }

/* ---------- Search results ---------- */
mark { background: var(--amber-100); color: var(--ink); padding: 0 2px; border-radius: 3px; }
.docs-result-count { font-weight: 700; color: var(--ink); margin-bottom: 18px; }
.docs-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.docs-result { padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-1); }
.docs-result h2 { font-size: 1.15rem; margin: 0 0 6px; }
.docs-result h2 a { text-decoration: none; }
.docs-result h2 a:hover { text-decoration: underline; }
.docs-result-meta { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--green-700); margin: 0 0 4px; }
.docs-result-snippet { margin: 0; color: var(--muted); font-size: .95rem; }
.docs-empty { padding: 22px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.docs-empty h2 { font-size: 1.15rem; }
.docs-empty p:last-child { margin-bottom: 0; }
.docs-browse { margin-top: 36px; }
.docs-browse h2 { font-size: 1.05rem; }
.docs-browse .chips { margin-bottom: 18px; }

@media print {
  .docs-search, .docs-nav, .docs-toc, .docs-help, .docs-pager, .docs-prose a.anchor { display: none !important; }
  .docs-layout { display: block; padding: 0; }
  .page-head::after { display: none; }
}
