/* Documentation pages: /app/documentation and /app/documentation/<slug>.
   Loaded by app/routes/app.documentation._index.jsx and app.documentation.$slug.jsx (links export). */

.doc-wrap { width: 100%; margin: 0; padding: 0 0 48px; color: #202223; }
.doc-wrap a { color: inherit; }

/* ── Hero with search ── */
.doc-hero {
  position: relative;
  padding: 44px 24px 56px;
  border-radius: 14px;
  text-align: center;
  color: #fff;
  background: radial-gradient(1200px 400px at 85% -20%, rgba(120, 190, 255, 0.35), transparent 60%),
    linear-gradient(135deg, #16213e 0%, #26408b 55%, #3a6df0 100%);
}
.doc-hero h1 { margin: 0 0 8px; font-size: 32px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.doc-hero p { margin: 0 auto 24px; max-width: 560px; font-size: 16px; line-height: 1.5; opacity: 0.9; }
.doc-search { position: relative; max-width: 640px; margin: 0 auto; text-align: left; }
.doc-search-box {
  display: flex; align-items: center; gap: 10px;
  background: #fff; color: #202223; border-radius: 12px; padding: 0 16px; height: 54px;
  box-shadow: 0 10px 30px rgba(10, 20, 60, 0.35);
}
.doc-search-box svg { width: 20px; height: 20px; fill: #6d7175; flex: none; }
.doc-search-box input {
  flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; height: 100%; min-width: 0; color: #202223;
}
.doc-search-clear { border: 0; background: transparent; cursor: pointer; font-size: 20px; line-height: 1; color: #6d7175; padding: 4px; }
.doc-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20;
  background: #fff; color: #202223; border-radius: 12px; overflow: hidden; max-height: 420px; overflow-y: auto;
  box-shadow: 0 16px 40px rgba(10, 20, 60, 0.35);
}
.doc-result { display: block; padding: 12px 16px; text-decoration: none; border-bottom: 1px solid #f1f2f3; }
.doc-result:last-child { border-bottom: 0; }
.doc-result:hover, .doc-result:focus { background: #f4f6ff; outline: 0; }
.doc-result b { display: block; font-size: 14px; font-weight: 600; }
.doc-result span { display: block; font-size: 12.5px; color: #6d7175; margin-top: 2px; }
.doc-noresult { padding: 16px; font-size: 14px; color: #6d7175; }
.doc-popular { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; font-size: 13px; }
.doc-popular a {
  text-decoration: none; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.16);
  color: #fff; font-size: 13px;
}
.doc-popular a:hover { background: rgba(255, 255, 255, 0.28); }

/* ── Folder cards ── */
.doc-section-title { margin: 32px 0 16px; font-size: 18px; font-weight: 650; }
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .doc-grid { grid-template-columns: 1fr; } .doc-hero h1 { font-size: 26px; } }
.doc-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid #e1e3e5; border-radius: 12px; padding: 20px;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.doc-card:hover { box-shadow: 0 8px 24px rgba(32, 34, 35, 0.09); border-color: #c9ccd0; transform: translateY(-1px); }
.doc-card-head { display: flex; gap: 14px; align-items: flex-start; }
.doc-icon {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px;
  background: #eef2ff;
}
.doc-card h2 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 650; }
.doc-card-desc { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: #6d7175; }
.doc-card ul { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid #f1f2f3; display: flex; flex-direction: column; gap: 2px; }
.doc-card li a {
  display: block; padding: 6px 8px; margin: 0 -8px; border-radius: 6px; font-size: 14px; text-decoration: none; color: #2c4cc8;
}
.doc-card li a:hover { background: #f4f6ff; text-decoration: underline; }
.doc-count { margin-top: auto; padding-top: 14px; font-size: 12.5px; color: #6d7175; }

.doc-support {
  margin-top: 32px; padding: 22px 24px; border-radius: 12px; background: #f6f6f7; border: 1px solid #e1e3e5;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
}
.doc-support b { display: block; font-size: 15px; }
.doc-support span { font-size: 13.5px; color: #6d7175; }
.doc-btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; background: #202223; color: #fff !important;
  text-decoration: none; font-size: 14px; font-weight: 600;
}
.doc-btn:hover { background: #000; }


/* ── Topics: 2-column white card, 3 articles per folder + "View all" ── */
.doc-topics {
  display: grid; grid-template-columns: 1fr 1fr; background: #fff; border: 1px solid #e1e3e5; border-radius: 14px; overflow: hidden;
}
@media (max-width: 760px) { .doc-topics { grid-template-columns: 1fr; } .doc-topic { border-right: 0 !important; } }
.doc-topic { padding: 26px 32px 24px; border-bottom: 1px solid #eceef0; min-width: 0; }
.doc-topic:nth-child(odd) { border-right: 1px solid #eceef0; }
.doc-topic:last-child, .doc-topic:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.doc-topic h2 { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 19px; line-height: 1.3; font-weight: 650; }
.doc-topic h2 a { color: #1f3a5f; text-decoration: none; }
.doc-topic h2 a:hover { text-decoration: underline; }
.doc-topic h2 small { font-size: inherit; font-weight: 650; color: #1f3a5f; }
.doc-folder-ico { flex: none; width: 26px; height: 26px; color: #1f3a5f; }
.doc-topic-desc { margin: 6px 0 0 38px; font-size: 13px; line-height: 1.45; color: #6d7175; }
.doc-topic-links { list-style: none; margin: 16px 0 0; padding: 0 0 0 38px; display: flex; flex-direction: column; gap: 14px; }
.doc-wrap .doc-topic-links a, .doc-wrap .doc-viewall { color: #2c4cc8; text-decoration: none; font-size: 15px; }
.doc-topic-links a { display: flex; align-items: center; gap: 10px; }
.doc-topic-links a:hover, .doc-viewall:hover { text-decoration: underline; }
.doc-file-ico { flex: none; width: 17px; height: 17px; }
.doc-viewall { display: inline-block; margin: 16px 0 0 38px; }

/* ── Folder page: every article of one folder ── */
.doc-layout.doc-layout-2 { grid-template-columns: 270px minmax(0, 1fr); }
@media (max-width: 820px) { .doc-layout.doc-layout-2 { grid-template-columns: 1fr; } }
.doc-folder-head { display: flex; gap: 14px; align-items: center; }
.doc-folder-head .doc-folder-ico { width: 34px; height: 34px; }
.doc-folder-head h1 { margin: 0; }
.doc-folder-list { list-style: none; margin: 8px 0 0; padding: 0; }
.doc-folder-list li + li { border-top: 1px solid #eceef0; }
.doc-wrap .doc-folder-list a { display: flex; gap: 14px; align-items: flex-start; padding: 16px 4px; text-decoration: none; color: inherit; }
.doc-folder-list a:hover b { text-decoration: underline; }
.doc-folder-list .doc-file-ico { margin-top: 3px; color: #2c4cc8; }
.doc-folder-list b { display: block; font-size: 16px; font-weight: 600; color: #2c4cc8; }
.doc-folder-list span { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.45; color: #6d7175; }

/* ── Article page ── */
.doc-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: #6d7175; margin: 4px 0 18px; }
.doc-crumbs a { color: #2c4cc8; text-decoration: none; }
.doc-crumbs a:hover { text-decoration: underline; }
.doc-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 210px; gap: 32px; align-items: start; }
@media (max-width: 1180px) { .doc-layout { grid-template-columns: 250px minmax(0, 1fr); } .doc-toc { display: none; } }
@media (max-width: 820px) { .doc-layout { grid-template-columns: 1fr; } }

.doc-side {
  position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 14px;
  background: #fff; border: 1px solid #e1e3e5; border-radius: 12px;
}
@media (max-width: 820px) { .doc-side { position: static; max-height: none; } }
.doc-side-home { display: block; padding: 6px 8px; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; text-decoration: none; border-radius: 6px; }
.doc-side-home:hover { background: #f4f6ff; }
.doc-side details { border-top: 1px solid #f1f2f3; }
.doc-side summary {
  list-style: none; cursor: pointer; padding: 10px 8px; font-size: 13.5px; font-weight: 650;
  display: flex; align-items: center; gap: 8px; border-radius: 6px;
}
.doc-side summary::-webkit-details-marker { display: none; }
.doc-side summary::after { content: "›"; margin-left: auto; font-size: 18px; color: #8c9196; transition: transform 0.15s; }
.doc-side details[open] > summary::after { transform: rotate(90deg); }
.doc-side summary:hover { background: #f6f6f7; }
.doc-side ul { list-style: none; margin: 0 0 8px; padding: 0 0 0 10px; }
.doc-side li a {
  display: block; padding: 6px 10px; font-size: 13.5px; line-height: 1.35; text-decoration: none; color: #4a4f55;
  border-left: 2px solid #e1e3e5; border-radius: 0 6px 6px 0;
}
.doc-side li a:hover { background: #f4f6ff; color: #202223; }
.doc-side li a[aria-current="page"] { border-left-color: #3a6df0; background: #eef2ff; color: #1b3aa8; font-weight: 600; }

.doc-article { background: #fff; border: 1px solid #e1e3e5; border-radius: 12px; padding: 32px 36px; min-width: 0; }
@media (max-width: 640px) { .doc-article { padding: 20px 18px; } }
.doc-folder-tag {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #eef2ff; color: #1b3aa8;
}
.doc-article h1 { margin: 12px 0 8px; font-size: 28px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
.doc-lead { margin: 0 0 8px; font-size: 16px; line-height: 1.55; color: #6d7175; }
.doc-article hr { border: 0; border-top: 1px solid #e1e3e5; margin: 20px 0 8px; }

/* Article body */
.doc-body { font-size: 15px; line-height: 1.7; }
.doc-body > * + * { margin-top: 16px; }
.doc-body h2 { margin-top: 32px; font-size: 21px; line-height: 1.3; font-weight: 650; scroll-margin-top: 16px; }
.doc-body h3 { margin-top: 24px; font-size: 17px; line-height: 1.3; font-weight: 650; scroll-margin-top: 16px; }
.doc-body p { margin-bottom: 0; }
.doc-body > :first-child { margin-top: 0; }
.doc-body a { color: #2c4cc8; text-decoration: underline; text-underline-offset: 2px; }
.doc-body ul, .doc-body ol { margin-bottom: 0; padding-left: 24px; }
.doc-body li > ul { margin-top: 6px; }
.doc-body li { padding-left: 4px; }
.doc-body li + li { margin-top: 6px; }
.doc-body ol > li::marker { font-weight: 650; color: #3a6df0; }
.doc-body code { background: #f1f2f3; padding: 1px 6px; border-radius: 4px; font-size: 13.5px; }

.doc-note {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; background: #eef4ff; border: 1px solid #cfdcff; border-left: 4px solid #3a6df0;
}
.doc-note::before { content: "💡"; flex: none; }
.doc-note div { flex: 1; min-width: 0; }

.doc-table-wrap { overflow-x: auto; border: 1px solid #e1e3e5; border-radius: 10px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.doc-table th { background: #f6f6f7; font-weight: 650; white-space: nowrap; }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid #e1e3e5; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table .doc-group td { background: #f6f6f7; font-weight: 650; }
.doc-yes { color: #0a7d4f; font-weight: 600; }
.doc-no { color: #a0a4a8; }

.doc-shot {
  margin: 0; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 20px; text-align: center; border: 2px dashed #c9ccd0; border-radius: 12px; background: #fafbfb;
}
.doc-shot-icon { font-size: 26px; opacity: 0.6; }
.doc-shot b { font-size: 14px; font-weight: 600; }
.doc-shot small { font-size: 12px; color: #8c9196; }
.doc-figure { margin: 0; padding: 5px 0; }
.doc-figure img { width: auto; height: auto; max-width: min(100%, 640px); max-height: 420px; object-fit: contain; display: block; border: 1px solid #e1e3e5; border-radius: 10px; }
.doc-figure figcaption { margin-top: 6px; font-size: 13px; color: #6d7175; }

.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.doc-pager a {
  display: block; padding: 14px 16px; border: 1px solid #e1e3e5; border-radius: 10px; text-decoration: none; background: #fff;
}
.doc-pager a:hover { border-color: #3a6df0; background: #f4f6ff; }
.doc-pager small { display: block; font-size: 12px; color: #6d7175; margin-bottom: 2px; }
.doc-pager b { font-size: 14.5px; color: #2c4cc8; font-weight: 600; }
.doc-pager .doc-next { text-align: right; grid-column: 2; }
.doc-pager .doc-prev { grid-column: 1; }

.doc-toc { position: sticky; top: 12px; font-size: 13px; }
.doc-toc b { display: block; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: #6d7175; margin-bottom: 10px; }
.doc-toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid #e1e3e5; text-decoration: none; color: #4a4f55; line-height: 1.35; }
.doc-toc a:hover { color: #1b3aa8; border-left-color: #3a6df0; }

/* ── Search: result highlighted with the arrow keys (same color as hover) ── */
.doc-result.is-active { background: #f4f6ff; outline: 0; }

/* ── Phone: the menu folds into a "Browse topics" button ── */
.doc-side-toggle { display: none; }
@media (max-width: 820px) {
  .doc-side { padding: 8px; }
  .doc-side-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 8px;
    border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; border-radius: 6px;
  }
  .doc-side:not(.is-open) .doc-side-body { display: none; }
  .doc-side.is-open .doc-side-toggle span { transform: rotate(180deg); }
}

/* ── Screenshots: click to enlarge ── */
/* The button only carries the keyboard focus and the click; the mouse (zoom cursor + click) works on the picture itself,
   so the empty space beside a picture that was shrunk by max-width does not react. */
.doc-figure-btn { display: block; max-width: 100%; padding: 0; border: 0; background: transparent; text-align: left; pointer-events: none; }
.doc-figure-btn img { pointer-events: auto; cursor: zoom-in; }
.doc-figure-btn:focus-visible { outline: none; }
.doc-figure-btn:focus-visible img { outline: 3px solid rgba(58, 109, 240, 0.5); outline-offset: 2px; }
.doc-lightbox {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px;
  background: rgba(20, 22, 25, 0.82); cursor: zoom-out;
}
.doc-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; background: #fff; }
.doc-lightbox-close {
  position: absolute; top: 12px; right: 16px; border: 0; background: transparent; color: #fff; font-size: 34px; line-height: 1; cursor: pointer;
}


/* ═════ Standalone site shell (replaces the Shopify Polaris page frame) ═════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: #f6f6f7; color: #202223;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.site-header { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid #e1e3e5; }
.site-header-in { max-width: 1320px; margin: 0 auto; padding: 0 24px; height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: #16213e; text-decoration: none; }
.site-brand span:last-child { font-weight: 500; color: #6d7175; }
.site-logo { width: 32px; height: 32px; border-radius: 8px; display: block; }
.site-nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.site-nav a { color: #4a4f55; text-decoration: none; }
.site-nav a:hover { color: #1b3aa8; }
.site-nav .site-cta { background: #202223; color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.site-nav .site-cta:hover { background: #000; color: #fff; }
.site-main { max-width: 1320px; margin: 0 auto; padding: 24px 24px 0; }
.site-footer { text-align: center; padding: 28px 16px 36px; font-size: 13px; color: #6d7175; }
@media (max-width: 640px) { .site-main { padding: 16px 12px 0; } .site-header-in { padding: 0 14px; } }

.doc-search-box svg { width: 20px; height: 20px; fill: #6d7175; flex: none; }
.doc-body img { max-width: 100%; }
.doc-appref { font-weight: 600; color: inherit; cursor: inherit; }
.doc-side { top: 70px; max-height: calc(100vh - 84px); }
.doc-toc { top: 78px; }
.doc-body h2, .doc-body h3 { scroll-margin-top: 76px; }
.doc-body a:focus-visible, .doc-wrap a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid rgba(58, 109, 240, 0.4); outline-offset: 2px; }

/* ── Live demo box ── */
.doc-demo {
  margin: 20px 0 28px; padding: 16px 20px; border-radius: 12px; background: #eefaf4; border: 1px solid #b4e5cc;
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
}
.doc-demo > svg { flex: none; width: 40px; height: 40px; padding: 9px; border-radius: 10px; background: #d3f2e2; color: #0f7a4f; }
.doc-demo > div { flex: 1 1 260px; min-width: 0; }
.doc-demo b { display: block; font-size: 15px; }
.doc-demo span { font-size: 13.5px; color: #4a5a52; }
.doc-demo code { background: #fff; border: 1px solid #b4e5cc; padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.doc-demo-btn { background: #0f7a4f; }
.doc-demo-btn:hover { background: #0a5c3b; }
