/* BicyCart documentation — styles */

:root {
  --brand:        #FF9A00;
  --on-brand:     #211500;
  --brand-dark:   #8A5300;
  --brand-soft:   #FFF4E3;

  --bg:           #FFFFFF;
  --bg-alt:       #FAF8F5;
  --surface:      #FFFFFF;
  --code-bg:      #F7F5F2;
  --ink:          #212121;
  --ink-2:        #4D4848;
  --muted:        #6A6666;
  --rule:         #E8E5E0;
  --shadow:       0 1px 2px rgba(32,26,26,.06), 0 8px 24px rgba(32,26,26,.06);

  --sidebar-w:    288px;
  --topbar-h:     56px;
  --radius:       10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand:      #FFAA29;
    --on-brand:   #211500;
    --brand-dark: #FFCA7A;
    --brand-soft: #2A2215;
    --bg:         #141111;
    --bg-alt:     #1A1616;
    --surface:    #1C1818;
    --code-bg:    #221D1D;
    --ink:        #F2EFEF;
    --ink-2:      #D6D0D0;
    --muted:      #9C9595;
    --rule:       #2E2828;
    --shadow:     0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --brand:      #FFAA29;
    --on-brand:   #211500;
  --brand-dark: #FFCA7A;
  --brand-soft: #2A2215;
  --bg:         #141111;
  --bg-alt:     #1A1616;
  --surface:    #1C1818;
  --code-bg:    #221D1D;
  --ink:        #F2EFEF;
  --ink-2:      #D6D0D0;
  --muted:      #9C9595;
  --rule:       #2E2828;
  --shadow:     0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 34%, transparent) transparent;
}
html::-webkit-scrollbar { width: 12px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 34%, transparent);
  border-radius: 99px; border: 3.5px solid transparent; background-clip: content-box;
}
html::-webkit-scrollbar-thumb:hover {
  background: var(--muted); background-clip: content-box;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip:focus {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  background: var(--brand); color: var(--on-brand); padding: 10px 16px;
  border-radius: 8px; text-decoration: none;
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 40;
  display: none; align-items: center; gap: 12px; padding: 0 14px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.topbar-brand { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.topbar-mark {
  width: 26px; height: 26px; flex: none; border-radius: 7px;
  background: #FFFFFF; border: 1px solid var(--rule); display: grid; place-items: center; overflow: hidden;
}
.topbar-mark img { width: 88%; height: 88%; object-fit: contain; display: block; }
.topbar-brand strong { color: var(--brand-dark); }
.topbar-brand span { color: var(--muted); font-size: 12.5px; }

.menu-btn {
  width: 38px; height: 34px; display: grid; align-content: center; gap: 4px;
  background: none; border: 1px solid var(--rule); border-radius: 8px;
  padding: 0 8px; cursor: pointer;
}
.menu-btn span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }

.theme-btn {
  margin-left: auto; width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: none; border: 1px solid var(--rule); border-radius: 8px;
  color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s, background-color .15s;
}
.theme-btn:hover {
  color: var(--brand-dark); border-color: var(--brand);
  background: var(--brand-soft);
}
.theme-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* The topbar is hidden above 1000px, so the sidebar carries the toggle there. */
.side-theme { display: grid; }
@media (max-width: 1000px) { .side-theme { display: none; } }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

/* --------------------------------------------------------------- sidebar */
.layout { display: flex; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 30;
  background: var(--bg-alt); border-right: 1px solid var(--rule);
  overflow-y: auto; overscroll-behavior: contain;
  /* Overlay-style scrollbar: invisible until the sidebar is hovered, so it
     never sits as a hard grey stripe against the content divider. */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color .2s;
}
.sidebar:hover, .sidebar:focus-within {
  scrollbar-color: var(--rule) transparent;
}
.sidebar::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: transparent; border-radius: 99px;
  border: 3px solid transparent; background-clip: content-box;
  transition: background-color .2s;
}
.sidebar:hover::-webkit-scrollbar-thumb,
.sidebar:focus-within::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  background-clip: content-box;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--muted); background-clip: content-box;
}

.sidebar-inner { padding: 26px 20px 48px; }

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-text { min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  background: #FFFFFF; border: 1px solid var(--rule); /* the logo is drawn on white in both themes */
  display: grid; place-items: center; overflow: hidden;
}
.brand-mark img {
  width: 88%; height: 88%; object-fit: contain; display: block;
}
.brand strong { display: block; font-size: 16px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: 11.5px; }

.search-wrap { display: block; margin-bottom: 16px; }
.search-wrap input {
  width: 100%; padding: 9px 12px; font: inherit; font-size: 13.5px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 8px;
}
.search-wrap input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

.nav-list { list-style: none; counter-reset: nav; margin: 0; padding: 0; }
.nav-list li { counter-increment: nav; }
.nav-list a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 6px 10px; margin-bottom: 1px;
  color: var(--ink-2); text-decoration: none; font-size: 13.8px;
  border-radius: 7px; border-left: 2px solid transparent;
}
.nav-list a::before {
  content: counter(nav, decimal-leading-zero);
  font: 600 10.5px/1.6 var(--mono); color: var(--muted); flex: none;
}
.nav-list a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.nav-list a.active {
  background: var(--brand-soft); color: var(--brand-dark);
  font-weight: 600; border-left-color: var(--brand);
}
.nav-list a.active::before { color: var(--brand); }
.nav-list li.hidden { display: none; }

.backdrop {
  display: none; position: fixed; inset: 0; z-index: 25;
  background: rgba(0,0,0,.45);
}

/* ------------------------------------------------------------------ main */
main {
  margin-left: var(--sidebar-w); flex: 1; min-width: 0;
  padding: 44px 56px 90px; max-width: 900px;
}

.hero { margin-bottom: 52px; }
.eyebrow {
  margin: 0 0 6px; font: 700 11px/1 var(--sans);
  letter-spacing: .14em; text-transform: uppercase; color: var(--brand);
}
.hero h1 {
  margin: 0; font-size: clamp(34px, 6vw, 52px); line-height: 1.05;
  letter-spacing: -.028em; font-weight: 800;
}
.lede { margin: 10px 0 0; font-size: 18px; color: var(--ink-2); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.hero-meta span {
  font-size: 12.2px; color: var(--muted);
  background: var(--bg-alt); border: 1px solid var(--rule);
  padding: 4px 10px; border-radius: 999px;
}
.thanks {
  margin: 22px 0 0; padding-left: 14px; border-left: 3px solid var(--brand);
  color: var(--muted); font-size: 14px;
}

section { margin-bottom: 56px; scroll-margin-top: 24px; }

h2 {
  margin: 0 0 18px; padding-bottom: 12px;
  font-size: 25px; font-weight: 750; letter-spacing: -.02em;
  color: var(--brand-dark); border-bottom: 2px solid var(--brand);
  display: flex; align-items: baseline; gap: 12px;
}
h2 .num { font: 700 13px/1 var(--mono); color: var(--brand); flex: none; }

h3 {
  margin: 30px 0 10px; font-size: 16.5px; font-weight: 700;
  letter-spacing: -.01em; color: var(--ink);
}

p { margin: 0 0 14px; color: var(--ink-2); }
main a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }

ul, ol { margin: 0 0 16px; padding-left: 22px; color: var(--ink-2); }
li { margin-bottom: 6px; }

ul.check { list-style: none; padding-left: 0; }
ul.check li { position: relative; padding-left: 26px; }
ul.check li::before {
  content: ""; position: absolute; left: 6px; top: .62em;
  width: 7px; height: 7px; border-radius: 2px; background: var(--brand);
}

ol.steps { list-style: none; counter-reset: step; padding-left: 0; }
ol.steps > li {
  counter-increment: step; position: relative;
  padding-left: 38px; margin-bottom: 14px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--brand-soft); color: var(--brand-dark);
  font: 700 12px/24px var(--mono); text-align: center;
}

/* ------------------------------------------------------------------ code */
code {
  font-family: var(--mono); font-size: .875em;
  background: var(--code-bg); color: var(--brand-dark);
  padding: .15em .42em; border-radius: 5px;
  border: 1px solid var(--rule);
  overflow-wrap: anywhere;
}

pre {
  position: relative; margin: 0 0 16px; padding: 15px 17px;
  background: var(--code-bg); border: 1px solid var(--rule);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius); overflow-x: auto;
}
pre code {
  background: none; border: 0; padding: 0; color: var(--ink);
  font-size: 13.1px; line-height: 1.62; white-space: pre; overflow-wrap: normal;
}
ol.steps pre { margin-top: 10px; }

/* Slim horizontal scrollbars on code blocks and tables, to match the sidebar. */
pre, .table-wrap {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 34%, transparent) transparent;
}
pre::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { height: 9px; }
pre::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track { background: transparent; }
pre::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 34%, transparent);
  border-radius: 99px; border: 3px solid transparent; background-clip: content-box;
}
pre::-webkit-scrollbar-thumb:hover, .table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--muted); background-clip: content-box;
}

.copy-btn {
  position: absolute; top: 8px; right: 8px;
  font: 600 11px/1 var(--sans); color: var(--muted);
  background: var(--surface); border: 1px solid var(--rule);
  padding: 5px 9px; border-radius: 6px; cursor: pointer;
  opacity: 0; transition: opacity .12s;
}
pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.copy-btn.done { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }

/* ---------------------------------------------------------------- tables */
.table-wrap {
  margin: 0 0 18px; border: 1px solid var(--rule);
  border-radius: var(--radius); overflow: auto hidden; overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; padding: 11px 14px; font-weight: 700; font-size: 13px;
  background: var(--bg-alt); color: var(--ink);
  border-bottom: 2px solid var(--brand); white-space: nowrap;
}
tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--rule);
  color: var(--ink-2); vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { white-space: nowrap; }
@media (max-width: 720px) { tbody td:first-child { white-space: normal; } }

/* ----------------------------------------------------------------- stats */
.stat-grid {
  display: grid; gap: 10px; margin: 0 0 18px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}
.stat {
  background: var(--bg-alt); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 14px 12px; text-align: center;
}
.stat b { display: block; font-size: 24px; font-weight: 800; color: var(--brand-dark); letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); }

/* -------------------------------------------------------------- callouts */
.callout {
  margin: 0 0 18px; padding: 14px 17px;
  background: var(--brand-soft); border-left: 3px solid var(--brand);
  border-radius: var(--radius);
}
.callout strong { display: block; margin-bottom: 4px; font-size: 13px; color: var(--brand-dark); }
.callout p { margin: 0; font-size: 14.2px; color: var(--ink-2); }
.callout.note, .callout.tip { background: var(--bg-alt); border-left-color: var(--muted); }
.callout.note strong, .callout.tip strong { color: var(--ink); }
.callout.warn { border-left-width: 4px; }

/* ----------------------------------------------------------- screenshots */
.shots {
  display: grid; gap: 18px; margin: 0 0 26px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.shots figure { margin: 0; }
.shots img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--rule); border-radius: 12px;
  background: var(--bg-alt);
}
.shots figcaption {
  margin-top: 7px; text-align: center;
  font-size: 12.5px; color: var(--muted);
}
@media (max-width: 480px) {
  .shots { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ------------------------------------------------------- support contact */
.contact {
  margin: 0 0 12px; padding: 16px 18px;
  background: var(--bg-alt); border: 1px solid var(--rule);
  border-left: 3px solid var(--brand); border-radius: var(--radius);
}
.contact-row {
  display: flex; gap: 14px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid var(--rule);
}
.contact-row:last-child { border-bottom: 0; }
.contact-label {
  flex: none; width: 66px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.contact-row a { color: var(--brand-dark); font-weight: 600; overflow-wrap: anywhere; }
.contact-note { font-size: 13.2px; color: var(--muted); }

@media (max-width: 460px) {
  .contact-row { flex-direction: column; gap: 2px; }
  .contact-label { width: auto; }
}

.closing {
  margin-top: 34px; padding: 22px; text-align: center;
  background: var(--brand-soft); border: 1px solid var(--brand);
  border-radius: var(--radius);
}
.closing strong { display: block; margin-bottom: 4px; font-size: 16px; }
.closing p { margin: 0; font-size: 14px; }

.foot {
  margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--rule);
  color: var(--muted); font-size: 12.5px;
}
.foot p { margin: 0; color: inherit; }

/* --------------------------------------------------------------- to-top */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 20;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); color: var(--on-brand); border: 0; cursor: pointer;
  font-size: 17px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .topbar { display: flex; }
  body { padding-top: var(--topbar-h); }
  .sidebar {
    top: var(--topbar-h); transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .backdrop.show { display: block; }
  main { margin-left: 0; padding: 30px 20px 80px; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  main { padding: 24px 16px 70px; }
  h2 { font-size: 21px; }
  .hero { margin-bottom: 38px; }
}

main h4 { margin: 22px 0 8px; font-size: 15px; color: var(--ink); }

@media print {
  .sidebar, .topbar, .to-top, .copy-btn, .backdrop { display: none !important; }
  .shots { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .shots figure, .stat, tr { break-inside: avoid; }
  h2, h3, h4 { break-after: avoid; }
  main { margin: 0; max-width: none; padding: 0; }
  pre, .table-wrap, .callout { break-inside: avoid; }
  section { break-inside: auto; }
}
