/* Fixwise Docs (docs.html). Uses the app's tokens from css/app.css. */
/* Colours: the docs are neutral black and grey. The app's purple tokens are
   pointed at ink here, so accents (the current tab and page, hovers, tags)
   stay quiet. Purple (--brand) is kept for the logo and the one main button. */
body.docs {
  /* --top: the header (64px) plus the tabs under it (46px). */
  --top: 110px; --side-w: 284px; --spring: cubic-bezier(.32, .72, 0, 1);
  --brand: #7367f0;
  --text-heading: #17171a; --text-body: #3d3d45; --text-muted: #6c6c78; --text-light: #9c9ca8;
  --border: rgba(20, 20, 25, .1); --border-strong: rgba(20, 20, 25, .17); --input-border: rgba(20, 20, 25, .24);
  --hover-bg: rgba(20, 20, 25, .05);
  --primary: #17171a; --primary-rgb: 23, 23, 26; --primary-soft: rgba(20, 20, 25, .06);
  margin: 0; background: var(--card-bg); color: var(--text-body); font-family: var(--font-sans);
}
html[data-theme="dark"] body.docs {
  --text-heading: #f2f2f5; --text-body: #cdcdd6; --text-muted: #9d9dab; --text-light: #777786;
  --border: rgba(255, 255, 255, .1); --border-strong: rgba(255, 255, 255, .17); --input-border: rgba(255, 255, 255, .24);
  --hover-bg: rgba(255, 255, 255, .06);
  --primary: #f2f2f5; --primary-rgb: 242, 242, 245; --primary-soft: rgba(255, 255, 255, .08);
  background: var(--body-bg);
}
.docs a { color: inherit; text-decoration: none; }

/* ============ Motion: the same feel as the app and the website ============ */
@keyframes dc-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes dc-leave { to { opacity: 0; transform: translateY(-10px); } }
@keyframes dc-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes dc-turn { from { opacity: 0; transform: rotate(-70deg) scale(.6); } }
@keyframes dc-link-on { from { background-color: transparent; transform: translateX(-6px); } }
/* Parts of a page wait unseen, then rise in when docs.js marks them .in
   (--d staggers the ones that arrive together). */
.dc-rise { opacity: 0; }
.dc-rise.in { opacity: 1; animation: dc-rise .65s var(--spring) backwards; animation-delay: var(--d, 0ms); }
/* The page being left slips up and out before the next one comes in. */
.dc-leave { animation: dc-leave .17s var(--ease) forwards; }
/* Switching theme cross-fades the whole page. */
html.dc-fade::view-transition-old(root) { animation: vt-root-out .35s ease both; }
html.dc-fade::view-transition-new(root) { animation: vt-root-fade .35s ease both; }

/* ============ Header ============ */
.dc-top {
  position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: calc(var(--side-w) - 1.5rem) minmax(0, 1fr) auto; align-items: center; gap: 1.5rem;
  height: 64px; margin: 0; padding: 0 1.5rem; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--card-bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
html[data-theme="dark"] .dc-top, html[data-theme="dark"] .dc-tabs { background: color-mix(in srgb, var(--body-bg) 86%, transparent); }
.dc-brand { display: inline-flex; align-items: center; gap: .3rem; justify-self: start; }
.dc-brand svg { transition: transform .35s var(--spring); }
.dc-brand:hover svg { transform: rotate(-8deg) scale(1.06); }
.dc-brand .brand-wm { font-size: 1.3rem; color: var(--text-heading); }
.dc-tag { margin-left: .5rem; padding: .15rem .5rem; border-radius: var(--r-sm); background: var(--primary-soft); color: var(--primary); font-size: .72rem; font-weight: 700; letter-spacing: .02em; }

.dc-search { position: relative; display: flex; align-items: center; gap: .6rem; max-width: 720px; height: 40px; padding: 0 .55rem 0 .85rem; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--card-bg); color: var(--text-muted); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.dc-search:hover { border-color: var(--input-border); }
.dc-search:focus-within { border-color: var(--text-muted); box-shadow: 0 0 0 3px var(--hover-bg); }
.dc-search > svg { flex: none; }
.dc-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text-heading); font: inherit; font-size: .92rem; }
.dc-search input::-webkit-search-cancel-button { display: none; }
.dc-search kbd { padding: .05rem .45rem; border: 1px solid var(--border-strong); border-radius: var(--r-xs); font: 600 .75rem var(--font-sans); color: var(--text-light); }
.dc-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5; max-height: 420px; overflow-y: auto; padding: .35rem; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card-bg); box-shadow: var(--shadow-lg); text-align: left; transform-origin: top; animation: dc-pop .2s var(--spring); }
.dc-results a { display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem; padding: .6rem .7rem; border-radius: var(--r); transition: background .15s var(--ease); }
.dc-results a strong { font-size: .9rem; color: var(--text-heading); }
.dc-results a small { font-size: .72rem; font-weight: 600; color: var(--text-light); }
.dc-results a span { grid-column: 1 / -1; font-size: .8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-results a.on, .dc-results a:hover { background: var(--primary-soft); }
.dc-none { margin: 0; padding: .9rem; font-size: .86rem; color: var(--text-muted); }

.dc-actions { display: flex; align-items: center; gap: .25rem; }
.dc-actions .btn { margin-left: .5rem; }
/* The one main button keeps the brand purple, flat, without the glow. */
.docs .btn-primary { background: var(--brand); box-shadow: none; }
.docs .btn-primary:hover { box-shadow: none; }
.dc-nav-link { padding: .42rem .8rem; border-radius: var(--r-pill); font-size: .9rem; font-weight: 500; color: var(--text-muted); transition: color var(--dur) var(--ease), background var(--dur) var(--ease); }
.dc-nav-link:hover { color: var(--text-heading); background: var(--hover-bg); }
.dc-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: var(--r); background: transparent; color: var(--text-muted); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease); }
.dc-icon:hover { background: var(--hover-bg); color: var(--text-heading); }
.dc-icon:active { transform: scale(.92); }
#dc-theme svg { animation: dc-turn .4s var(--spring); }
.dc-menu-btn { display: none; }

/* Tabs under the header: Guides and the FAQ */
.dc-tabs { background: color-mix(in srgb, var(--card-bg) 86%, transparent); }
.dc-top { border-bottom-color: transparent; }
.dc-tabs {
  position: sticky; top: 64px; z-index: 29; display: flex; gap: 1.75rem; height: 46px; padding: 0 1.5rem; border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.dc-tabs a { position: relative; display: flex; align-items: center; font-size: .9rem; font-weight: 500; color: var(--text-muted); transition: color .2s var(--ease); }
.dc-tabs a:hover { color: var(--text-heading); }
.dc-tabs a.on { color: var(--text-heading); }
/* One underline that glides to the tab you're on (placed by docs.js). */
.dc-ink { position: absolute; left: 0; bottom: -1px; width: 0; height: 2px; border-radius: 2px; background: var(--primary); pointer-events: none; }
.dc-ink.ready { transition: transform .5s cubic-bezier(.22, 1, .36, 1), width .5s cubic-bezier(.22, 1, .36, 1); }

/* ============ Sidebar ============ */
/* app.css zooms the page, which shrinks vh too; dividing by --zoom gives the full height back. */
.dc-wrap { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh / var(--zoom, 1) - var(--top)); }
.dc-side { position: sticky; top: var(--top); align-self: start; height: calc(100vh / var(--zoom, 1) - var(--top)); overflow-y: auto; padding: 1.5rem 1rem 5rem 1.5rem; border-right: 1px solid var(--border); scrollbar-width: thin; }
.dc-sgroup { margin: 1.6rem 0 .4rem; font-size: .8rem; font-weight: 700; color: var(--text-heading); }
.dc-sgroup:first-child { margin-top: 0; }
.dc-sec-h { display: flex; align-items: center; gap: .7rem; width: calc(100% + .6rem); margin-left: -.6rem; padding: .5rem .6rem; border: 0; border-radius: var(--r); background: none; color: var(--text-body); font: inherit; font-size: .92rem; text-align: left; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.dc-sec-h:hover { background: var(--hover-bg); color: var(--text-heading); }
.dc-sec-h > svg { flex: none; color: var(--text-light); transition: color .15s var(--ease); }
.dc-sec-h:hover > svg, .dc-sec.open .dc-sec-h > svg { color: var(--primary); }
.dc-sec-h span { flex: 1; }
.dc-chev { display: grid; color: var(--text-light); transition: transform .3s var(--spring); }
.dc-sec.open .dc-chev { transform: rotate(180deg); }
/* Switching tabs swaps the list; its rows rise in one after the other. */
.dc-side.swap > * { animation: dc-rise .5s var(--spring) backwards; }
.dc-side.swap > :nth-child(2) { animation-delay: 40ms; }
.dc-side.swap > :nth-child(3) { animation-delay: 80ms; }
.dc-side.swap > :nth-child(4) { animation-delay: 120ms; }
.dc-side.swap > :nth-child(5) { animation-delay: 160ms; }
.dc-side.swap > :nth-child(6) { animation-delay: 200ms; }
.dc-side.swap > :nth-child(n + 7) { animation-delay: 240ms; }
/* A section folds by animating its one grid row from 0 to its full height. */
.dc-sec-links { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s var(--spring); }
.dc-sec.open .dc-sec-links { grid-template-rows: 1fr; }
.dc-sec-links > div { min-height: 0; overflow: hidden; margin-left: .23rem; padding-left: .85rem; border-left: 1px solid var(--border); visibility: hidden; transition: visibility 0s .32s; }
.dc-sec.open .dc-sec-links > div { visibility: visible; transition-delay: 0s; }
.dc-link { display: block; padding: .36rem .65rem; line-height: 1.4; border-radius: var(--r); font-size: .88rem; color: var(--text-muted); transition: background .15s var(--ease), color .15s var(--ease), transform .2s var(--ease); }
.dc-link:first-child { margin-top: .2rem; }
.dc-link:last-child { margin-bottom: .35rem; }
.dc-link:hover { color: var(--text-heading); transform: translateX(2px); }
.dc-link.on { color: var(--primary); background: var(--primary-soft); font-weight: 600; animation: dc-link-on .4s var(--spring); }

/* ============ Content ============ */
.dc-main { min-width: 0; padding: 3.5rem 2rem 7rem; }
.dc-home { max-width: 960px; margin: 0 auto; }
.dc-article { max-width: 740px; margin: 0 auto; }
.dc-home h1, .dc-article h1 { margin: 0; font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--text-heading); }
.dc-lead { margin: .9rem 0 0; max-width: 36rem; font-size: 1.08rem; line-height: 1.6; color: var(--text-muted); }
.dc-h2 { margin: 3rem 0 1.1rem; font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; color: var(--text-heading); }

/* Cards: one for each section */
.dc-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.dc-card { padding: 1.3rem 1.4rem 1.15rem; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--card-bg); transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease); }
.dc-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.dc-card h3 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .7rem; font-size: 1rem; font-weight: 700; color: var(--text-heading); }
.dc-card h3 svg { color: var(--text-muted); transition: color .25s var(--ease); }
.dc-card:hover h3 svg { color: var(--primary); }
.dc-card a { display: block; padding: .3rem 0; font-size: .92rem; color: var(--text-body); transition: color .2s var(--ease), transform .2s var(--ease); }
.dc-card a:hover { color: var(--primary); transform: translateX(3px); }

/* ============ Article ============ */
.dc-crumbs { display: flex; gap: .5rem; margin-bottom: 1rem; font-size: .82rem; color: var(--text-light); }
.dc-crumbs a { transition: color .2s var(--ease); }
.dc-crumbs a:hover { color: var(--primary); }
.dc-body { margin-top: 1.5rem; font-size: 1rem; line-height: 1.75; color: var(--text-body); }
.dc-body p { margin: 0 0 1rem; }
.dc-body h3 { margin: 1.8rem 0 .7rem; font-size: 1.1rem; font-weight: 700; color: var(--text-heading); }
.dc-body h3:first-child { margin-top: 0; }
.dc-body ul, .dc-body ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.dc-body li { margin-bottom: .45rem; padding-left: .2rem; }
.dc-body li::marker { color: var(--text-light); font-weight: 600; }
.dc-body b { color: var(--text-heading); font-weight: 600; }
/* Links in the text are ink with an underline that darkens on hover. */
.dc-body a { color: var(--text-heading); font-weight: 600; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: text-decoration-color .2s var(--ease); }
.dc-body a:hover { text-decoration-color: currentColor; }
.dc-tip, .dc-note { display: block; padding: .85rem 1rem; border-radius: var(--r-lg); font-size: .92rem; line-height: 1.6; }
.dc-tip { background: var(--hover-bg); border: 1px solid var(--border); }
.dc-note { background: var(--body-bg); border: 1px solid var(--border); }
html[data-theme="dark"] .dc-note { background: var(--card-bg); }
.dc-tip b, .dc-note b { display: block; margin-bottom: .2rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.dc-note b { color: var(--text-muted); }
.dc-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: 0 0 1.3rem; }
.dc-roles div { padding: .8rem .95rem; border: 1px solid var(--border); border-radius: var(--r-lg); }
.dc-roles b { display: block; margin-bottom: .1rem; }
.dc-roles span { font-size: .88rem; line-height: 1.5; color: var(--text-muted); }
.dc-table { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); }
.dc-table table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .88rem; }
.dc-table th, .dc-table td { padding: .7rem .9rem; text-align: center; border-bottom: 1px solid var(--border); }
.dc-table tbody tr { transition: background .15s var(--ease); }
.dc-table tbody tr:hover { background: var(--hover-bg); }
.dc-table tbody tr:last-child > * { border-bottom: 0; }
.dc-table thead th { font-size: .75rem; font-weight: 700; color: var(--text-heading); background: var(--body-bg); }
html[data-theme="dark"] .dc-table thead th { background: var(--card-bg); }
.dc-table tbody th { text-align: left; font-weight: 500; color: var(--text-body); }
.dc-yes { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(var(--success-rgb), .14); color: var(--success); font-size: .75rem; font-weight: 800; }
.dc-no { color: var(--text-light); }
.dc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.dc-pager a { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1.1rem; border: 1px solid var(--border); border-radius: var(--r-lg); transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease); }
.dc-pager a:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.dc-pager .next { text-align: right; }
.dc-pager small { font-size: .75rem; color: var(--text-light); }
.dc-pager span { font-weight: 600; color: var(--text-heading); transition: color .2s var(--ease); }
.dc-pager a:hover span { color: var(--primary); }

/* ============ FAQ ============ */
/* Questions are longer than guide titles, so they wrap and sit a little tighter. */
.dc-cards-faq { margin-top: 3rem; }
.dc-cards-faq .dc-card h3 { margin-bottom: .6rem; }
.dc-card a { line-height: 1.45; }
.dc-article h1.dc-question { font-size: 2rem; line-height: 1.25; }

/* ============ Smaller screens ============ */
@media (max-width: 1100px) {
  .dc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dc-nav-link { display: none; }
}
@media (max-width: 860px) {
  .dc-top { grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; padding: 0 1rem; }
  .dc-tabs { padding: 0 1rem; }
  .dc-tag, .dc-actions .btn { display: none; }
  .dc-menu-btn { display: grid; }
  .dc-wrap { grid-template-columns: minmax(0, 1fr); }
  /* The sidebar becomes a drawer, opened from the menu button. */
  .dc-side { position: fixed; top: var(--top); left: 0; z-index: 20; width: min(300px, 86vw); background: var(--card-bg); box-shadow: var(--shadow-lg); transform: translateX(-102%); transition: transform .32s var(--spring); }
  body.dc-open .dc-side { transform: none; }
  .dc-main { padding: 2rem 1.1rem 6rem; }
  .dc-home h1, .dc-article h1 { font-size: 1.85rem; }
  .dc-article h1.dc-question { font-size: 1.55rem; }
  .dc-cards, .dc-roles { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .dc-brand .brand-wm { display: none; }
  .dc-search kbd { display: none; }
  .dc-pager { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .dc-rise { opacity: 1; }
  .dc-rise.in, .dc-leave, .dc-link.on, .dc-side.swap > *, .dc-results, #dc-theme svg { animation: none; }
  .docs *, .docs *::after { transition-duration: .01s !important; }
}
