/* Help Center: guns' help center (Nextra docs theme, dark) 1:1. Every size, colour and spacing below was measured from
   their saved pages; their purple is mapped to our pink. Search keeps our own popup (theirs wasn't captured). */
:root {
  --h-bg: #0e0e0e; --h-text: #e2e8f0; --h-head: #f1f5f9; --h-muted: #9ca3af; --h-side: #a3a3a3; --h-line: #131313;
  --h-accent: #f27db3; --h-accent-rgb: 242, 125, 179;
  --h-nav: 64px;
}
* { box-sizing: border-box; }
html { background: var(--h-bg); color-scheme: dark; scroll-padding-top: calc(var(--h-nav) + 16px); }
body.docs { margin: 0; min-height: 100%; background: var(--h-bg); color: #fff; font: 400 16px/24px Satoshi, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---------- navbar ---------- */
.h-nav { position: sticky; top: 0; z-index: 20; height: var(--h-nav); }
.h-nav::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(14, 14, 14, .7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 2px solid var(--h-line); }
.h-nav nav { display: flex; align-items: center; gap: 16px; height: 100%; padding: 0 24px; }
.h-brand { display: flex; align-items: center; gap: 8px; margin-inline-end: auto; text-decoration: none; }
.h-brand img { width: 28px; height: 28px; object-fit: cover; }
.h-brand h1 { margin: 0; color: #fafafa; font-size: 20px; font-weight: 500; line-height: 30px; }
.h-brand h1 span { color: var(--h-accent); }
.h-brand h1 em { font-style: normal; }
.h-search { position: relative; display: flex; align-items: center; color: #d1d5db; }
.h-search input { width: 256px; padding: 8px 64px 8px 12px;border: 0; border-radius: 8px; background: rgba(249, 250, 251, .1); color: #d1d5db; font: 400 14px/17.5px Satoshi, sans-serif; outline: 0; transition: all .15s; cursor: pointer; }
.h-search input::placeholder { color: #9ca3af; }
.h-search kbd { position: absolute; right: 6px; top: 7px; display: flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border: 1px solid var(--h-line); border-radius: 4px; background: #0e0e0e; color: var(--h-muted); font: 500 11px/16.5px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; pointer-events: none; }
.h-icon { display: block; color: #fff; font-size: 20.5px; line-height: 1; text-decoration: none; }
.h-icon[hidden] { display: none; }
.h-burger { display: none; border: 0; background: none; padding: 6px; cursor: pointer; font-size: 20px; }

/* ---------- page: sidebar · article · on this page ---------- */
.h-page { display: flex; max-width: 100%; }
.h-side { position: sticky; top: var(--h-nav); flex: none; align-self: flex-start; width: 310px; height: calc(100vh - var(--h-nav)); display: flex; flex-direction: column;
  border-right: 2px solid var(--h-line); border-radius: 0 50px 50px 0; }
.h-side-in { padding: 16px 16px 0; overflow-y: auto; scrollbar-width: none; }
.h-side-in::-webkit-scrollbar { display: none; }
.h-side ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.h-link, .h-folder { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 11px; border: 0; border-radius: 15px; background: none; color: var(--h-side);
  font-size: 14px; line-height: 20px; text-align: start; text-decoration: none; cursor: pointer; transition: color .15s, background-color .15s; }
.h-link:hover, .h-folder:hover { background: rgba(var(--h-accent-rgb), .05); color: #f9fafb; }
.h-link.on { background: rgba(var(--h-accent-rgb), .1); color: var(--h-accent); font-weight: 600; }
.h-folder i { margin-inline-start: auto; width: 18px; height: 18px; padding: 2px; display: grid; place-items: center; font-size: 11px; transition: transform .2s; }
.h-group:not(.open) .h-folder i { transform: rotate(-90deg); }
.h-sub { position: relative; margin-left: 12px !important; padding: 4px 0 0 12px !important; }
.h-sub::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px; background: #262626; }
.h-group:not(.open) .h-sub { display: none; }

.h-article { flex: 1; min-width: 0; display: flex; justify-content: center; padding: 35px 48px; overflow-wrap: break-word; color: var(--h-text); }
.h-main { width: 100%; max-width: 860px; min-height: calc(100vh - var(--h-nav) - 70px); }
.h-crumb { display: flex; align-items: center; gap: 4px; margin-top: 6px; color: var(--h-muted); font-size: 14px; line-height: 20px; }
.h-crumb a { text-decoration: none; white-space: nowrap; transition: color .15s; }
.h-crumb a:hover { color: #f3f4f6; }
.h-crumb i { width: 14px; font-size: 10px; text-align: center; }
.h-crumb span { color: #f3f4f6; font-weight: 500; white-space: nowrap; }
.h-main h1 { margin: 8px 0 0; color: var(--h-head); font-size: 36px; font-weight: 700; line-height: 40px; letter-spacing: -.9px; }
.h-main h2 { margin: 40px 0 0; padding-bottom: 4px; border-bottom: 1px solid var(--h-line); color: var(--h-head); font-size: 27.5px; font-weight: 600; line-height: 33px; letter-spacing: -.6875px; }
.h-main h3 { margin: 32px 0 0; color: var(--h-head); font-size: 24px; font-weight: 600; line-height: 32px; letter-spacing: -.6px; }
.h-anchor { margin-inline-start: 4px; opacity: 0; text-decoration: none; transition: opacity .15s; }
.h-anchor::after { content: "#"; padding: 0 4px; color: #a3a3a3; }
:hover > .h-anchor, :target > .h-anchor { opacity: 1; }
.h-main p { margin: 20px 0 0; line-height: 28px; }
.h-main b, .h-main strong { font-weight: 700; }
.h-main ul, .h-main ol { margin: 10px 0 0 24px; padding: 0; }
.h-main ul { list-style: disc; } .h-main ol { list-style: decimal; }
.h-main li { margin: 8px 0; }
.h-main a:not(.h-card):not(.h-anchor):not(.h-pn a):not(.h-crumb a) { color: var(--h-accent); text-decoration: underline; text-underline-offset: 2px; }
.h-main code { padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); font: .9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.h-main hr { margin: 32px 0; border: 0; border-top: 1px solid var(--h-line); }
/* cards: a link to another article (full width in articles, three columns on the home page) */
.h-card { display: flex; margin-top: 10px; border: 2px solid rgba(186, 58, 118, .24); border-radius: 20px; background: rgba(214, 74, 140, .153); color: #fafafa; text-decoration: none; transition: background-color .15s, border-color .15s; }
.h-card:hover { background: rgba(204, 72, 135, .255); border-color: rgba(186, 58, 118, .42); }
.h-card > span { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 16px; color: #e5e5e5; font-weight: 500; }
.h-card i { width: 24px; flex: none; color: #fafafa; font-size: 20px; text-align: center; }
.h-card b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(250px, calc((100% - 2rem) / 3)), 1fr)); gap: 16px; margin-top: 16px; }
/* callout (info) */
.h-callout { display: flex; margin-top: 20px; padding: 8px 16px 8px 0; border: 2px solid rgba(28, 56, 142, .443); border-radius: 25px; background: rgba(23, 37, 84, .3); color: #60a5fa; overflow-x: auto; }
.h-callout > i { flex: none; padding: 0 8px 0 12px; font-size: 16px; line-height: 28px; }
.h-callout > div { min-width: 0; line-height: 28px; }
.h-callout b, .h-callout strong { font-weight: 700; }
.h-callout a { color: inherit !important; }
/* tables and badges (our own content types) */
.h-table { margin-top: 20px; overflow-x: auto; }
.h-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.h-table th, .h-table td { padding: 8px 12px; border: 1px solid #1f1f1f; text-align: left; }
.h-table th { background: #141414; color: var(--h-head); font-weight: 600; }
.h-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 20px; }
.h-badge { display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; align-items: center; padding: 12px 14px; border: 2px solid var(--h-line); border-radius: 15px; background: #121212; }
.h-badge b { font-weight: 600; color: var(--h-head); }
.h-badge span { grid-column: 2; color: var(--h-muted); font-size: 14px; }
.h-badge > :first-child { grid-row: span 2; }
/* home */
.h-home-search { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 0 -3px; }
.h-home-search input { width: 100%; height: 45px; padding: 0 15px; border: 0; border-radius: 25px; background: rgba(249, 250, 251, .1); color: #d1d5db; font: 400 14px/17.5px Satoshi, sans-serif; outline: 0; cursor: pointer; }
.h-home-search input::placeholder { color: #9ca3af; }
/* previous / next */
.h-pn { display: flex; align-items: center; margin: 64px 0 32px; padding-top: 32px; border-top: 1px solid var(--h-line); }
.h-pn a { display: flex; align-items: center; gap: 4px; max-width: 50%; padding: 16px 16px 16px 0; color: var(--h-muted); font-size: 18px; font-weight: 500; line-height: 28px; text-decoration: none; transition: color .15s; }
.h-pn a.next { margin-left: auto; padding: 16px 0 16px 16px; }
.h-pn a:hover { color: var(--h-accent); }
.h-pn i { font-size: 13px; width: 20px; text-align: center; }
/* on this page */
.h-toc { flex: none; width: 256px; }
.h-toc > div { position: sticky; top: var(--h-nav); display: grid; font-size: 14px; line-height: 20px; }
.h-toc p { margin: 0; padding: 35px 16px 0; color: #fff; font-weight: 600; letter-spacing: -.35px; }
.h-toc ul { margin: 0; padding: 16px 16px 12px; list-style: none; border-bottom: 1px solid var(--h-line); }
.h-toc li { margin: 8px 0; }
.h-toc a { display: block; margin-left: 12px; padding: 0 11px; border-radius: 15px; color: var(--h-muted); text-decoration: none; transition: color .15s; }
.h-toc a:hover { color: #e5e7eb; }

/* ---------- footer ---------- */
.h-foot { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; width: 100%; padding: 0 30px; background: #101010; border: 2px solid var(--h-line); }
.h-foot-in { display: flex; justify-content: space-between; align-items: center; gap: 45px; width: 100%; max-width: 78rem; margin: 60px 25px; padding: 0 15px; }
.h-foot-left { display: flex; flex-direction: column; gap: 60px; }
.h-service { display: flex; flex-direction: column; gap: 15px; }
.h-foot-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.h-foot-logo img { width: 34px; height: 34px; }
.h-foot-logo h1 { margin: 0; color: #fafafa; font-size: 24px; font-weight: 500; line-height: 36px; }
.h-foot-logo h1 span { color: var(--h-accent); }
.h-service > span { max-width: 350px; color: #cfcece; font-size: 16px; }
.h-socials { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.h-socials a { color: #b4b4b4; font-size: 27px; text-decoration: none; transition: all .3s; }
.h-socials a:hover { color: #fafafa; }
.h-copy { color: #aaa8a8; font-size: 15px; line-height: 22.5px; }
.h-foot-right { display: flex; gap: 55px; }
.h-cat-sep { display: flex; gap: 55px; }
.h-cat h1 { margin: 0; color: #fafafa; font-size: 21px; font-weight: 450; line-height: 31.5px; }
.h-cat-links { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.h-cat-links a { color: #aaa8a8; font-size: 15.5px; line-height: 23.25px; text-decoration: none; transition: all .3s; }
.h-cat-links a:hover { color: #ccc; }
.h-ext { display: inline; vertical-align: baseline; flex: none; }

/* ---------- search popup (ours) ---------- */
.d-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: start center; padding: 12vh 16px 16px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.d-modal[hidden] { display: none; }
.d-modal-card { width: min(600px, 100%); border: 2px solid #1c1c1c; border-radius: 18px; background: #111; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.d-modal-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #1c1c1c; color: var(--h-muted); }
.d-modal-input input { flex: 1; min-width: 0; border: 0; background: none; color: #fafafa; font: 400 16px Satoshi, sans-serif; outline: 0; }
.d-modal-input kbd { padding: 2px 6px; border: 1px solid #222; border-radius: 6px; font: 11px ui-monospace, monospace; }
.d-results { max-height: 50vh; overflow-y: auto; padding: 8px; }
.d-result { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; }
.d-result:hover, .d-result:focus { background: rgba(var(--h-accent-rgb), .08); outline: 0; }
.d-result i { width: 20px; color: var(--h-accent); text-align: center; }
.d-result div { display: grid; } .d-result small { color: var(--h-muted); }
.d-noresult { padding: 16px; color: var(--h-muted); }

/* ---------- light theme: guns' help center follows the system theme. Values from their light page (saved screenshot
   and CSS); their cards, callout border, sidebar edge and footer keep the same colours in both themes. ---------- */
@media (prefers-color-scheme: light) {
  :root { --h-bg: #fafafa; --h-text: #314158; --h-head: #0f172b; --h-muted: #4a5565; --h-side: #4a5565; --h-line: #e5e7eb; --h-accent-text: #9f386f; }
  html { color-scheme: light; }
  body.docs { color: #000; }
  .h-nav::before { background: rgba(250, 250, 250, .7); }
  .h-brand h1 { color: #000; }   /* guns leaves this white (invisible on their light page) */
  .h-search, .h-search input { color: #101828; }
  .h-search input, .h-home-search input { background: rgba(0, 0, 0, .05); color: #101828; }
  .h-search input::placeholder, .h-home-search input::placeholder { color: var(--h-muted); }
  .h-search kbd { background: #fafafa; }
  .h-icon { color: #000; }
  .h-side { border-right-color: #131313; }
  .h-link:hover, .h-folder:hover { color: #101828; }
  .h-link.on { background: #fff; color: var(--h-accent-text); }
  .h-sub::before { background: #e5e7eb; }
  .h-crumb a:hover, .h-crumb span { color: #000; }
  .h-anchor::after { color: var(--h-muted); }
  .h-main a:not(.h-card):not(.h-anchor):not(.h-pn a):not(.h-crumb a), .h-pn a:hover { color: var(--h-accent-text); }
  .h-main code { background: rgba(0, 0, 0, .05); }
  .h-card > span { color: #364153; }
  .h-callout { background: #dbeafe; color: #1447e6; }
  .h-table th, .h-table td { border-color: #e5e7eb; }
  .h-table th { background: #f3f4f6; }
  .h-badge { background: #fff; }
  .h-toc p { color: #000; }
  .h-toc a:hover { color: #101828; }
  .d-modal-card { border-color: #e5e7eb; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .15); }
  .d-modal-input { border-bottom-color: #e5e7eb; }
  .d-modal-input input { color: #101828; }
  .d-modal-input kbd { border-color: #e5e7eb; }
  .d-modal { background: rgba(0, 0, 0, .3); }
}

/* ---------- smaller screens (Nextra: on this page goes under 1280px, the sidebar becomes a menu under 768px) ---------- */
@media (max-width: 1279px) { .h-toc { display: none; } }
@media (max-width: 1100px) {
  .h-foot-in { flex-direction: column-reverse; align-items: self-start; }
  .h-foot-left { gap: 35px; }
  .h-service > span { max-width: 270px; }
}
@media (max-width: 767px) {
  .h-search, .h-nav .h-icon { display: none; }
  .h-burger { display: block; }
  .h-side { position: fixed; z-index: 15; top: var(--h-nav); left: 0; bottom: 0; width: 100%; height: auto; border: 0; border-radius: 0; background: var(--h-bg); transform: translateX(-100%); transition: transform .25s; }
  body.side-open .h-side { transform: none; }
  body.side-open { overflow: hidden; }
  .h-side-in { padding-bottom: 24px; }
  .h-article { padding: 16px 24px 32px; }
  .h-foot { padding: 0 16px; }
  .h-foot-in { margin: 40px 0; padding: 0; }
  .h-foot-right, .h-cat-sep { flex-direction: column; gap: 30px; }
}
@media (max-width: 480px) { .h-brand h1 em { display: none; } }
