/* StoreCashier documentation — layout + components. */
:root {
	--brand: #0b5b54;
	--brand-2: #0f766e;
	--brand-soft: #e6f3f1;
	--accent: #f59e0b;
	--bg: #ffffff;
	--bg-2: #f7f9fa;
	--bg-3: #eef2f4;
	--text: #1d2a33;
	--text-2: #4a5a66;
	--muted: #6b7b87;
	--line: #dfe6ea;
	--link: #0b6e64;
	--code-bg: #f1f4f6;
	--shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
	--free: #2271b1;
	--free-bg: #e7f0f8;
	--pro: #a15c00;
	--pro-bg: #fff4dd;
	--app: #6b3fc9;
	--app-bg: #f0eafd;
	--tip: #0f7b48;   --tip-bg: #e9f7ef;
	--note: #2263a8;  --note-bg: #eaf2fb;
	--warn: #a4400b;  --warn-bg: #fff1e6;
	--header-h: 60px;
	--side-w: 280px;
	--toc-w: 230px;
	--radius: 8px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	color-scheme: light;
}
:root[data-theme="dark"] {
	--brand: #2dd4bf; --brand-2: #5eead4; --brand-soft: #0f2a28; --accent: #fbbf24;
	--bg: #0f1417; --bg-2: #141b1f; --bg-3: #1b2429; --text: #e3e9ec; --text-2: #b6c3ca; --muted: #8a9aa4;
	--line: #273238; --link: #5eead4; --code-bg: #1b2429; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
	--free: #7cb8ec; --free-bg: #12283b; --pro: #fbbf55; --pro-bg: #33260b; --app: #b79cf5; --app-bg: #261d3d;
	--tip: #6ee7a8; --tip-bg: #0f2a1d; --note: #8cc0f5; --note-bg: #11233a; --warn: #fdae7a; --warn-bg: #351c0d;
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
img { max-width: 100%; height: auto; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--bg); padding: 8px 12px; border: 2px solid var(--brand); }
.skip-link:focus { left: 8px; }
.dashicons { vertical-align: middle; }

/* ---------- header ---------- */
.doc-header {
	position: sticky; top: 0; z-index: 40; height: var(--header-h);
	display: flex; align-items: center; gap: 14px; padding: 0 18px;
	background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex-shrink: 0; }
.brand img { border-radius: 7px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; }
.brand-text small { font-size: 12px; color: var(--muted); }
.versions { display: flex; gap: 6px; flex-shrink: 0; }
.vbadge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.vbadge.free { background: var(--free-bg); color: var(--free); }
.vbadge.pro { background: var(--pro-bg); color: var(--pro); }
.vbadge.app { background: var(--app-bg); color: var(--app); }
.doc-search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.doc-search > .dashicons { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.doc-search input {
	width: 100%; height: 38px; padding: 0 36px 0 36px; font: inherit; font-size: 15px;
	background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
}
.doc-search input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--bg); }
.search-key { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
.search-results {
	position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: min(70vh, 560px); overflow: auto;
	background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
}
.search-results a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.search-results a small { display: block; color: var(--muted); font-size: 12px; }
.search-results a .sr-title { font-weight: 600; }
.search-results a .sr-snip { display: block; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-results a.active, .search-results a:hover { background: var(--brand-soft); }
.search-results mark { background: rgba(245, 158, 11, .3); color: inherit; border-radius: 2px; padding: 0 1px; }
.search-results .sr-empty { padding: 12px; color: var(--muted); margin: 0; }
.hlinks { display: flex; gap: 14px; flex-shrink: 0; }
.hlinks a { color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.hlinks a:hover { color: var(--link); }
.icon-btn { background: none; border: 0; color: var(--text-2); cursor: pointer; padding: 6px; border-radius: 6px; line-height: 1; }
.icon-btn:hover { background: var(--bg-3); color: var(--text); }
.menu-toggle, .search-toggle { display: none; }

/* ---------- shell ---------- */
.doc-shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); max-width: 1600px; margin: 0 auto; }
.doc-sidebar {
	position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto;
	padding: 14px 10px 30px; border-right: 1px solid var(--line); background: var(--bg); font-size: 14.5px;
	overscroll-behavior: contain;
}
.side-home { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-weight: 600; margin-bottom: 6px; }
.side-home:hover { background: var(--bg-3); }
.side-home.current { background: var(--brand-soft); color: var(--brand); }
.nav-group { margin-bottom: 2px; }
.nav-group-title {
	display: flex; width: 100%; align-items: center; gap: 8px; padding: 7px 10px; background: none; border: 0;
	color: var(--text); font: inherit; font-weight: 600; text-align: left; border-radius: 6px; cursor: pointer;
}
.nav-group-title:hover { background: var(--bg-3); }
.nav-group-title .dashicons { color: var(--brand-2); font-size: 18px; width: 18px; height: 18px; }
.nav-group-title .label { flex: 1; }
.nav-group-title .caret::before { content: ""; display: inline-block; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.nav-group.open .caret::before { transform: rotate(45deg); }
.nav-group ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 18px; display: none; border-left: 1px solid var(--line); margin-left: 18px; }
.nav-group.open ul { display: block; }
.nav-group li a { display: block; padding: 5px 10px; color: var(--text-2); text-decoration: none; border-radius: 5px; line-height: 1.35; }
.nav-group li a:hover { color: var(--text); background: var(--bg-3); }
.nav-group li a.current { color: var(--brand); background: var(--brand-soft); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-2); }
.side-foot { margin-top: 16px; padding: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.side-foot a { color: var(--muted); }
.sidebar-backdrop { display: none; }

.doc-main { min-width: 0; padding: 26px 44px 40px; }
.doc-main:focus { outline: none; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--link); }
.doc-article { max-width: 860px; }

.doc-toc { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 26px 16px 30px 6px; font-size: 13.5px; }
.toc-title { font-weight: 700; text-transform: uppercase; font-size: 11.5px; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.doc-toc li a { display: block; padding: 3px 10px; color: var(--text-2); text-decoration: none; line-height: 1.4; margin-left: -1px; border-left: 2px solid transparent; }
.doc-toc li.toc-h3 a { padding-left: 22px; font-size: 13px; }
.doc-toc li a:hover { color: var(--text); }
.doc-toc li a.active { color: var(--brand); border-left-color: var(--brand-2); font-weight: 600; }
.toc-top { display: inline-block; margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- typography ---------- */
.doc-article h1 { font-size: 2.05rem; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.01em; }
.doc-article h2 { font-size: 1.45rem; line-height: 1.3; margin: 2.2em 0 .6em; padding-top: .6em; border-top: 1px solid var(--line); }
.doc-article h3 { font-size: 1.15rem; margin: 1.7em 0 .5em; }
.doc-article h4 { font-size: 1rem; margin: 1.4em 0 .4em; }
.doc-article h2 .anchor, .doc-article h3 .anchor { margin-left: 8px; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; transition: opacity .15s; }
.doc-article h2:hover .anchor, .doc-article h3:hover .anchor, .doc-article .anchor:focus { opacity: 1; }
.doc-article p, .doc-article ul, .doc-article ol { margin: 0 0 1em; }
.doc-article li { margin: .25em 0; }
.doc-article li > ul, .doc-article li > ol { margin: .3em 0 .3em; }
.doc-article code { font-family: var(--mono); font-size: .88em; background: var(--code-bg); padding: .1em .35em; border-radius: 4px; word-break: break-word; }
.doc-article pre { background: var(--code-bg); padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; font-size: 14px; line-height: 1.5; border: 1px solid var(--line); }
.doc-article pre code { background: none; padding: 0; font-size: inherit; word-break: normal; }
.doc-article hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.doc-article blockquote { margin: 1em 0; padding: 4px 16px; border-left: 4px solid var(--line); color: var(--text-2); }
.lead { font-size: 1.15rem; color: var(--text-2); line-height: 1.6; }
.where {
	display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 18px; padding: 6px 12px;
	background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; font-size: 14px; color: var(--text-2);
}
.where::before { content: "\f230"; font-family: dashicons; font-size: 17px; color: var(--brand-2); }
kbd {
	display: inline-block; font-family: var(--mono); font-size: .8em; line-height: 1.2; padding: 2px 6px; min-width: 1.6em; text-align: center;
	background: var(--bg); color: var(--text); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; white-space: nowrap;
}

/* ---------- badges ---------- */
.badge { display: inline-block; vertical-align: middle; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 4px; line-height: 1.4; font-family: var(--font); }
h1 .badge { font-size: 12px; position: relative; top: -3px; }
.badge.free { background: var(--free-bg); color: var(--free); }
.badge.pro { background: var(--pro-bg); color: var(--pro); }
.badge.app { background: var(--app-bg); color: var(--app); }
.badge.new { background: var(--tip-bg); color: var(--tip); }
.badge.beta, .badge.addon { background: var(--warn-bg); color: var(--warn); }

/* ---------- callouts ---------- */
.callout { position: relative; margin: 1.2em 0; padding: 12px 16px 12px 46px; border-radius: var(--radius); border: 1px solid; background: var(--note-bg); border-color: color-mix(in srgb, var(--note) 30%, transparent); }
.callout::before { position: absolute; left: 14px; top: 12px; font-family: dashicons; font-size: 20px; line-height: 1.3; content: "\f348"; color: var(--note); }
.callout > :last-child { margin-bottom: 0; }
.callout > :first-child { margin-top: 0; }
.callout.tip { background: var(--tip-bg); border-color: color-mix(in srgb, var(--tip) 30%, transparent); }
.callout.tip::before { content: "\f339"; color: var(--tip); }
.callout.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.callout.warn::before { content: "\f534"; color: var(--warn); }
.callout.pro { background: var(--pro-bg); border-color: color-mix(in srgb, var(--pro) 30%, transparent); }
.callout.pro::before { content: "\f155"; color: var(--pro); }
.callout.app { background: var(--app-bg); border-color: color-mix(in srgb, var(--app) 30%, transparent); }
.callout.app::before { content: "\f470"; color: var(--app); }

/* ---------- tables ---------- */
.doc-article table { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-size: 14.5px; }
.table-wrap { overflow-x: auto; margin: 1em 0 1.4em; }
.table-wrap table { margin: 0; }
.doc-article th, .doc-article td { padding: 9px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-article thead th { background: var(--bg-2); font-weight: 600; white-space: nowrap; }
.doc-article tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg-2) 55%, transparent); }
table.fields td:first-child { font-weight: 600; min-width: 150px; }
table.fields td:last-child { color: var(--text-2); }
table.fields th:first-child { width: 24%; }

/* ---------- steps ---------- */
ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
ol.steps > li { counter-increment: step; position: relative; padding: 2px 0 12px 46px; margin: 0; }
ol.steps > li::before {
	content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
	background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
:root[data-theme="dark"] ol.steps > li::before { color: #0f1417; }
ol.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 2px; width: 2px; background: var(--line); }

/* ---------- figures ---------- */
figure.shot { margin: 1.4em 0 1.8em; }
figure.shot img { display: block; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); cursor: zoom-in; background: var(--bg-2); }
figure.shot figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; text-align: center; }
figure.shot.half { max-width: 430px; }
.shots-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.shots-2 figure.shot { margin: .6em 0; }

/* ---------- cards / grids (home & overviews) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 1em 0 1.6em; }
.card { display: block; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.card:hover { border-color: var(--brand-2); box-shadow: var(--shadow); }
.card h3, .card strong { display: block; margin: 0 0 4px; font-size: 1.02rem; }
.card p { margin: 0; font-size: 14px; color: var(--text-2); }
.card .dashicons { color: var(--brand-2); font-size: 24px; width: 24px; height: 24px; margin-bottom: 6px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 1em 0 1.6em; }
.price { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--bg); }
.price.featured { border-color: var(--brand-2); box-shadow: 0 0 0 2px var(--brand-soft); }
.price h3 { margin: 0 0 6px; font-size: 1.05rem; }
.price .amount { font-size: 1.5rem; font-weight: 700; color: var(--brand); }
.price .amount small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.price ul { padding-left: 18px; font-size: 14px; margin: 10px 0 0; }

/* ---------- FAQ ---------- */
details.faq { border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; background: var(--bg); }
details.faq > summary { cursor: pointer; padding: 11px 14px 11px 38px; font-weight: 600; list-style: none; position: relative; }
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::before { content: "+"; position: absolute; left: 14px; top: 9px; font-size: 18px; color: var(--brand-2); font-weight: 700; }
details.faq[open] > summary::before { content: "\2212"; }
details.faq[open] > summary { border-bottom: 1px solid var(--line); }
details.faq > :not(summary) { margin: 10px 14px; }
details.faq > p:last-child { margin-bottom: 12px; }

/* ---------- related ---------- */
.related { margin-top: 2.6em; padding: 16px 20px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.related h2 { margin: 0 0 8px !important; padding: 0 !important; border: 0 !important; font-size: 1.1rem !important; }
.related ul { margin: 0; padding-left: 0; list-style: none; columns: 2; column-gap: 24px; }
.related li { break-inside: avoid; padding-left: 16px; position: relative; }
.related li::before { content: "›"; position: absolute; left: 2px; color: var(--brand-2); font-weight: 700; }

/* ---------- pager & footer ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 860px; margin: 40px 0 0; }
.pager a { display: block; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); }
.pager a:hover { border-color: var(--brand-2); }
.pager small { display: block; color: var(--muted); font-size: 12.5px; }
.pager span { font-weight: 600; color: var(--link); }
.pager .prev small::before { content: "← "; }
.pager .next { text-align: right; grid-column: 2; }
.pager .next small::after { content: " →"; }
.doc-footer { max-width: 860px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.doc-footer p { margin: 4px 0; }
.doc-footer a { color: var(--muted); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 12, 15, .9); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 100px); border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #fff; }
.lightbox-cap { color: #e3e9ec; font-size: 14px; margin: 12px 0 0; text-align: center; max-width: 900px; }
.lightbox-close { position: absolute; top: 12px; right: 16px; background: none; border: 0; color: #fff; font-size: 36px; line-height: 1; cursor: pointer; padding: 4px 10px; }
body.no-scroll { overflow: hidden; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
	.doc-shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
	.doc-toc { display: none; }
}
@media (max-width: 1080px) {
	.versions { display: none; }
}
@media (max-width: 900px) {
	:root { --header-h: 56px; }
	.doc-shell { grid-template-columns: minmax(0, 1fr); }
	.menu-toggle { display: inline-block; }
	.doc-sidebar {
		position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; height: 100%; width: min(320px, 86vw);
		transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); padding-top: 16px;
	}
	body.nav-open .doc-sidebar { transform: none; }
	.sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.45); }
	.sidebar-backdrop[hidden] { display: none; }
	.doc-main { padding: 18px 16px 30px; }
	.hlinks { display: none; }
	.doc-header { gap: 8px; padding: 0 10px; }
	.doc-article h1 { font-size: 1.65rem; }
	.doc-article h2 { font-size: 1.28rem; }
	.related ul { columns: 1; }
	.shots-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.search-toggle { display: inline-block; margin-left: auto; }
	.doc-search { display: none; position: absolute; left: 8px; right: 8px; top: calc(var(--header-h) - 2px); max-width: none; background: var(--bg); padding: 8px; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
	body.search-open .doc-search { display: block; }
	.doc-search > .dashicons { left: 18px; }
	.search-key { display: none; }
	.doc-search .search-results { position: static; margin-top: 6px; box-shadow: none; }
	.pager { grid-template-columns: 1fr; }
	.pager .next { grid-column: 1; }
	.doc-article table { font-size: 13.5px; }
	.doc-article th, .doc-article td { padding: 7px 8px; }
	.where { display: flex; }
	ol.steps > li { padding-left: 40px; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- print ---------- */
@media print {
	:root { --bg: #fff; --text: #000; --text-2: #222; --line: #ccc; }
	.doc-header, .doc-sidebar, .doc-toc, .pager, .sidebar-backdrop, .lightbox, .skip-link, .anchor, .crumbs { display: none !important; }
	.doc-shell { display: block; }
	.doc-main { padding: 0; }
	.doc-article { max-width: none; }
	body { font-size: 11pt; background: #fff; color: #000; }
	a { color: #000; }
	.doc-article a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
	figure.shot, table, .callout, details.faq, pre { break-inside: avoid; }
	figure.shot img { box-shadow: none; max-height: 9cm; width: auto; }
	details.faq > :not(summary) { display: block; }
	h2, h3 { break-after: avoid; }
	.doc-footer { border-top: 1px solid #ccc; }
}
