/*
 * css/docs.css: docs.html only, in flovia's docs layout (reference captures docs_1440.png, docs_390.png):
 * left table of contents, prose column, right "On this page" rail, mono code blocks, link cards, step flow.
 */
.docs-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-block: 1.5rem 5rem; }
.docs-sidebar details { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.docs-sidebar summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: .6rem .9rem; font-size: .9rem; font-weight: 500; }
.docs-sidebar summary svg { width: .9rem; height: .9rem; color: var(--muted); transition: transform .15s; }
.docs-sidebar details[open] summary svg { transform: rotate(180deg); }
.docs-sidebar nav { padding: .25rem .5rem .75rem; }
.docs-nav-group + .docs-nav-group { margin-top: .9rem; }
.docs-nav-group p { padding: .25rem .5rem; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-size: .62rem; font-weight: 500; }
.docs-nav-group a { display: flex; align-items: center; gap: .5rem; min-height: 36px; padding: .35rem .5rem; border-radius: 6px; color: var(--body); font-size: .86rem; transition: color .12s, background .12s; }
.docs-nav-group a:hover { color: var(--ink); background: var(--surface-2); }
.docs-nav-group a.is-active, .docs-nav-group a[aria-current="true"] { color: var(--ink); background: #ececec; font-weight: 500; }
.docs-nav-group a svg { width: .85rem; height: .85rem; color: var(--muted); flex: none; }
.docs-main { min-width: 0; max-width: 46rem; }
.docs-breadcrumb { display: flex; align-items: center; gap: .5rem; color: var(--dim); font-size: .78rem; }
.docs-breadcrumb a { color: var(--dim); }
.docs-breadcrumb a:hover { color: var(--ink); }
.docs-page-heading { margin-top: 1rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--line); }
.docs-title-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem 1rem; }
.docs-page-heading h1 { font-size: clamp(1.75rem, 3.4vw, 2.25rem); letter-spacing: -.035em; line-height: 1.15; text-wrap: balance; }
.docs-description { margin-top: .9rem; color: var(--body); font-size: 1.02rem; line-height: 1.65; max-width: 36rem; }
.docs-section { padding-top: 2.75rem; scroll-margin-top: calc(var(--nav-h) + 1.25rem); }
.docs-section h2 { font-size: 1.38rem; letter-spacing: -.025em; line-height: 1.25; }
.docs-section h2 a { color: inherit; }
.docs-section h2 a span { margin-left: .35rem; color: var(--faint); font-weight: 400; opacity: 0; transition: opacity .12s; }
.docs-section h2 a:hover span { opacity: 1; }
.docs-section h3 { margin-top: 1.75rem; font-size: 1.05rem; letter-spacing: -.015em; scroll-margin-top: calc(var(--nav-h) + 1.25rem); }
.docs-section p, .docs-section li { color: var(--body); font-size: .95rem; line-height: 1.75; }
.docs-section p { margin-top: .9rem; }
.docs-section p strong, .docs-section li strong { color: var(--ink); font-weight: 600; }
.docs-section p a, .docs-section li a, .docs-section td a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.docs-section p a:hover, .docs-section li a:hover, .docs-section td a:hover { text-decoration-color: var(--ink); }
.docs-section ul, .docs-section ol { margin-top: .75rem; padding-left: 1.4rem; display: grid; gap: .4rem; }
.docs-section ul { list-style: disc; }
.docs-section ol { list-style: decimal; }
.docs-section li::marker { color: var(--dim); font-family: var(--mono); font-size: .8rem; }
.docs-section code { padding: .1rem .35rem; border-radius: 4px; background: #f1f1f1; color: var(--ink); font-size: .84em; overflow-wrap: anywhere; }
.docs-section pre { position: relative; margin-top: 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow-x: auto; font-size: .78rem; line-height: 1.65; color: var(--ink); -webkit-overflow-scrolling: touch; }
.docs-section pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.docs-section pre .c { color: var(--dim); }
.docs-section pre .k { color: var(--accent-text); }
.docs-code { position: relative; }
.docs-code-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1.25rem; padding: .45rem .9rem; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--surface-2); font-family: var(--mono); font-size: .66rem; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.docs-code-head + pre { margin-top: 0; border-radius: 0 0 10px 10px; }
.docs-copy { display: inline-flex; align-items: center; gap: .3rem; min-height: 28px; padding: .15rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--body); font: 500 .68rem var(--sans); letter-spacing: 0; text-transform: none; }
.docs-copy:hover { color: var(--ink); border-color: var(--line-strong); }
.docs-copy svg { width: .75rem; height: .75rem; }
.docs-table-wrap { margin-top: 1rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.docs-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.docs-table th, .docs-table td { padding: .65rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); line-height: 1.55; }
.docs-table th { background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: .8rem; white-space: nowrap; }
.docs-table td { color: var(--body); }
.docs-table td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }
.docs-table tr:last-child td { border-bottom: 0; }
.docs-table code { white-space: nowrap; }
@media (max-width: 600px) {
  /* phones: each row stacks (the label and a short value share a line, the last cell takes the full width under them),
     so no column is squeezed to a sliver or cut off inside the scrolling wrap */
  .docs-table, .docs-table thead, .docs-table tbody { display: block; }
  .docs-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; padding: .65rem .85rem; border-bottom: 1px solid var(--line-soft); }
  .docs-table thead tr { background: var(--surface-2); }
  .docs-table tbody tr:last-child { border-bottom: 0; }
  .docs-table th, .docs-table td, .docs-table td:first-child { padding: 0; border-bottom: 0; white-space: normal; }
  .docs-table th:last-child, .docs-table td:last-child, .docs-table :is(th, td):first-child:nth-last-child(2) { grid-column: 1 / -1; }
  .docs-table td:first-child code { white-space: normal; }
}
.docs-flow { margin-top: 1.25rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.docs-flow figcaption { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .9rem; border-bottom: 1px solid var(--line-soft); background: var(--surface-2); font-size: .8rem; color: var(--ink); font-weight: 500; }
.docs-flow figcaption span { color: var(--dim); font-family: var(--mono); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; align-self: center; }
.docs-flow ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; gap: 0; }
.docs-flow li { display: flex; flex-direction: column; gap: .2rem; padding: .85rem .9rem; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); font-size: .82rem; }
.docs-flow li:nth-child(2n) { border-right: 0; }
.docs-flow li:nth-last-child(-n+2) { border-bottom: 0; }
.docs-flow-index { font-family: var(--mono); color: var(--accent-text); font-size: .64rem; font-weight: 600; }
.docs-flow li strong { color: var(--ink); font-weight: 600; }
.docs-flow li span:last-child { color: var(--dim); font-size: .78rem; }
.docs-cards { display: grid; gap: .75rem; margin-top: 1.25rem; }
.docs-card { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; transition: border-color .12s, box-shadow .12s; }
.docs-card:hover { border-color: var(--line-strong); box-shadow: 0 2px 10px -6px rgba(17, 17, 17, .18); }
.docs-card strong { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--ink); font-size: .9rem; font-weight: 600; }
.docs-card strong svg { width: .8rem; height: .8rem; color: var(--muted); flex: none; }
.docs-card span { color: var(--body); font-size: .84rem; line-height: 1.55; }
.docs-callout { display: flex; gap: .7rem; margin-top: 1.25rem; padding: .9rem 1rem; border: 1px solid #bfe9c6; border-radius: 10px; background: var(--accent-tint); }
.docs-callout svg { width: 1rem; height: 1rem; flex: none; margin-top: .2rem; color: var(--accent-text); }
.docs-callout p { margin: 0; color: var(--ink); font-size: .9rem; }
.docs-toc { display: none; }
.docs-toc-inner { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
.docs-toc p { font-size: .76rem; font-weight: 600; color: var(--ink); margin-bottom: .5rem; }
.docs-toc a { display: block; padding: .3rem 0 .3rem .75rem; margin-left: 1px; border-left: 2px solid var(--line-soft); color: var(--dim); font-size: .8rem; line-height: 1.4; transition: color .12s, border-color .12s; }
.docs-toc a:hover { color: var(--ink); }
.docs-toc a.is-active { color: var(--accent-text); border-left-color: var(--brand); }
.docs-next { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .86rem; }
.docs-next a { color: var(--ink); font-weight: 500; }
.docs-faq details { border-bottom: 1px solid var(--line-soft); }
.docs-faq details:first-of-type { border-top: 1px solid var(--line); margin-top: 1.25rem; }
.docs-faq summary { position: relative; min-height: 44px; padding: .9rem 2.25rem .9rem 0; color: var(--ink); font-size: .95rem; font-weight: 500; }
.docs-faq summary::after { content: '+'; position: absolute; top: 50%; right: .25rem; transform: translateY(-50%); font-family: var(--mono); color: var(--dim); transition: transform .16s; }
.docs-faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.docs-faq details p { margin: 0; padding: 0 2.25rem 1rem 0; font-size: .9rem; }
@media (min-width: 768px) {
  .docs-layout { grid-template-columns: 14rem minmax(0, 1fr); gap: 3rem; padding-block: 2rem 6rem; }
  .docs-sidebar details { border: 0; background: none; }
  .docs-sidebar summary { display: none; }
  .docs-sidebar nav { position: sticky; top: calc(var(--nav-h) + 1.5rem); max-height: calc(100vh - var(--nav-h) - 3rem); overflow-y: auto; padding: 0; }
  .docs-flow ol { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .docs-flow li { border-bottom: 0; }
  .docs-flow li:nth-child(2n) { border-right: 1px solid var(--line-soft); }
  .docs-flow li:last-child { border-right: 0; }
  .docs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .docs-layout { grid-template-columns: 14rem minmax(0, 1fr) 12rem; gap: 3.5rem; }
  .docs-toc { display: block; }
}
