/* ============================================================
   Sample Passkey file browser ([passkey_demo] shortcode)
   Loaded only on pages that use the shortcode.
   ============================================================ */

.pp-demo {
	--demo-sticky-top: calc(var(--header-h) + 24px);
	--i-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M12 15V3'/%3E%3C/svg%3E");
	--i-check-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
	--i-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	display: grid;
	grid-template-columns: 300px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
	margin-top: 0;
}
.pp-demo-nav p, .pp-demo-nav ul, .pp-demo-file-head p { margin: 0; }
.pp-demo .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- File list ---------- */
.pp-demo-nav { position: sticky; top: var(--demo-sticky-top); max-height: calc(100vh - var(--demo-sticky-top) - 24px); overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.pp-demo-prop { padding: 20px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 20px; }
.pp-demo-prop-name { font-family: var(--font-serif); font-size: 24px; line-height: 1.1; }
.pp-demo-prop-sub { margin-top: 6px !important; font-size: 14px; color: var(--text-muted); }
.pp-demo-download {
	display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
	font-size: 15px; font-weight: 500; color: var(--blue-text);
}
.pp-demo-download::before {
	content: ''; width: 16px; height: 16px; background: currentColor;
	-webkit-mask: var(--i-download) center / contain no-repeat; mask: var(--i-download) center / contain no-repeat;
}
.pp-demo-group { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); padding: 0 12px 8px; }
.pp-demo-tabs { list-style: none; padding: 0; }
.pp-demo-tabs + .pp-demo-group { margin-top: 20px !important; }
.pp-demo-tabs li { margin: 0; }
.pp-demo-tab {
	display: block; padding: 10px 12px; border-radius: var(--radius-sm);
	border-left: 2px solid transparent; color: var(--text); text-decoration: none;
	transition: background var(--t-fast), border-color var(--t-fast);
}
.pp-demo-tab:hover { background: var(--white); text-decoration: none; }
.pp-demo-tab[aria-current="true"] { background: var(--white); border-left-color: var(--blue); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.pp-demo-tab-name { display: block; font-family: var(--font-mono); font-size: 14px; font-weight: 500; }
.pp-demo-tab[aria-current="true"] .pp-demo-tab-name { color: var(--blue-text); }
.pp-demo-tab-job { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--text-muted); }

/* ---------- File panel ---------- */
.pp-demo-panels { min-width: 0; }
.pp-demo-file { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; scroll-margin-top: var(--demo-sticky-top); }
.pp-demo-file[hidden] { display: none; }
.pp-demo-file + .pp-demo-file { margin-top: 24px; } /* no-JS: files stack */
.pp-demo-file-head {
	display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-start; justify-content: space-between;
	padding: 24px 28px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.pp-demo-file-title { min-width: 0; flex: 1 1 320px; }
.pp-demo-file-title h2 { margin: 0; font-family: var(--font-mono); font-size: clamp(22px, 2.4vw, 28px); font-weight: 500; letter-spacing: -0.01em; font-variation-settings: normal; }
.pp-demo-file-job { margin-top: 6px !important; font-size: 16px; color: var(--text-muted); }
.pp-demo-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 14px; font-size: 13px; color: var(--text-muted); }
.pp-demo-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; line-height: 1.5; }
.pp-demo-badge.is-operator-verified { background: var(--blue-100); color: var(--blue-text); }
.pp-demo-badge.is-operator-verified::before { content: ''; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--i-check) center / contain no-repeat; mask: var(--i-check) center / contain no-repeat; }
.pp-demo-badge.is-inferred { background: var(--bg-alt); color: #45484D; }
.pp-demo-badge.is-platform-suggested { background: #FFF1DB; color: #7A4A00; }
.pp-demo-badge.is-extended { background: var(--white); color: var(--text); border: 1px dashed var(--border-strong); }

.pp-demo:not(.is-enhanced) .pp-demo-file-actions { display: none; }
.pp-demo-file-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pp-demo-toggle { display: inline-flex; padding: 3px; background: var(--white); border: 1px solid var(--border-strong); border-radius: 999px; }
.pp-demo-toggle button, .pp-demo-copy {
	font: 500 14px/1 var(--font-sans); cursor: pointer; min-height: 36px; padding: 0 16px;
	border-radius: 999px; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.pp-demo-toggle button { border: 0; background: transparent; color: var(--text-muted); }
.pp-demo-toggle button:hover { color: var(--text); }
.pp-demo-toggle button[aria-pressed="true"] { background: var(--text); color: var(--white); }
.pp-demo-copy { border: 1px solid var(--border-strong); background: var(--white); color: var(--text); min-height: 42px; }
.pp-demo-copy:hover { border-color: var(--text); }
.pp-demo-copy.is-copied { border-color: var(--blue-text); color: var(--blue-text); }
.pp-demo-copy[hidden] { display: none; }

.pp-demo-body[hidden] { display: none; }

/* ---------- Rendered markdown ---------- */
.pp-md { padding: 28px 28px 40px; font-size: 16px; line-height: 1.6; }
.pp-md > * { max-width: 780px; }
.pp-md > * { margin-bottom: 0; }
.pp-md > * + * { margin-top: 16px; }
.pp-md strong { font-weight: 600; }
.pp-md h3, .pp-md h4, .pp-md h5, .pp-md h6 { font-variation-settings: normal; margin-bottom: 0; }
.pp-md h3 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(28px, 3vw, 36px); line-height: 1.1; margin-top: 0; }
.pp-md h4 { font-family: var(--font-serif); font-weight: 400; font-size: 24px; line-height: 1.2; margin-top: 40px; }
.pp-md h5 { font-family: var(--font-sans); font-weight: 700; font-size: 17px; margin-top: 28px; }
.pp-md h6 { font-family: var(--font-sans); font-weight: 700; font-size: 15px; margin-top: 20px; }
.pp-md hr { max-width: none; border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.pp-md hr + h4 { margin-top: 0; }
.pp-md p em:only-child { color: var(--text-muted); }
.pp-md ul, .pp-md ol { padding-left: 22px; }
.pp-md li + li { margin-top: 4px; }
.pp-md blockquote { margin-left: 0; margin-right: 0; padding: 12px 18px; border-left: 3px solid var(--blue); background: var(--bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.pp-md blockquote > * + * { margin-top: 6px; }
.pp-md code { font-size: 0.88em; padding: 1px 5px; background: var(--bg-alt); border-radius: 4px; }
.pp-md pre { padding: 16px 18px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-x: auto; font-size: 13px; line-height: 1.55; }
.pp-md pre code { padding: 0; background: none; font-size: inherit; }
.pp-md a.pp-md-ref { text-decoration: none; }
.pp-md a.pp-md-ref code { color: var(--blue-text); background: var(--blue-100); }
.pp-md a.pp-md-ref:hover code { text-decoration: underline; text-underline-offset: 3px; }
.pp-md .pp-md-task { list-style: none; display: flex; gap: 10px; align-items: baseline; margin-left: -22px; }
.pp-md .pp-md-box { flex-shrink: 0; width: 15px; height: 15px; border: 1.5px solid var(--border-strong); border-radius: 4px; transform: translateY(2px); }
.pp-md .pp-md-task.is-done .pp-md-box { background: var(--blue-text) var(--i-check-white) center / 11px no-repeat; border-color: var(--blue-text); }

.pp-md-table { max-width: none !important; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pp-md table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
.pp-md th, .pp-md td { text-align: left; vertical-align: top; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border); }
.pp-md thead th { background: var(--bg); font-size: 13px; font-weight: 700; white-space: nowrap; }
.pp-md tbody tr:last-child td { border-bottom: 0; }
.pp-md td:first-child { font-weight: 500; }

/* ---------- Raw markdown ---------- */
.pp-demo-raw {
	margin: 0; padding: 28px; background: #16181C; color: #E6E7EA;
	font-family: var(--font-mono); font-size: 13.5px; line-height: 1.65;
	white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4;
	max-height: none; border-radius: 0;
}
.pp-demo-raw:focus-visible { outline-offset: -3px; outline-color: var(--blue-300); }
.pp-demo-raw code { font: inherit; background: none; padding: 0; color: inherit; }
.pp-demo-raw .md-fm { color: #9DA3AD; }
.pp-demo-raw .md-key { color: #75B9FB; }
.pp-demo-raw .md-h { color: #FFFFFF; font-weight: 700; }
.pp-demo-raw .md-hr, .pp-demo-raw .md-pipe, .pp-demo-raw .md-fence { color: #7C828C; }
.pp-demo-raw .md-b { color: #FFFFFF; font-weight: 700; }
.pp-demo-raw .md-c { color: #9FD8A8; }
.pp-demo-raw .md-k { color: #F2C47A; }
.pp-demo-raw .md-q, .pp-demo-raw .md-li { color: #75B9FB; }
.pp-demo-raw .md-pre { color: #C9CBCF; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
	.pp-demo { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.pp-demo-nav { position: static; max-height: none; overflow: visible; padding-right: 0; }
	.pp-demo-prop { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 16px 18px; margin-bottom: 16px; }
	.pp-demo-prop-sub { margin-top: 0 !important; }
	.pp-demo-download { margin-top: 0; margin-left: auto; }
	/* File list collapses to a select (added by JS; without JS the list stays) */
	.pp-demo.is-enhanced .pp-demo-group, .pp-demo.is-enhanced .pp-demo-tabs { display: none; }
	.pp-demo.is-enhanced .pp-demo-select-wrap { display: block; }
}
.pp-demo-select-wrap { display: none; }
.pp-demo-select-wrap label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.pp-demo-select {
	width: 100%; min-height: 48px; padding: 0 44px 0 14px; appearance: none; -webkit-appearance: none;
	font: 500 16px/1.2 var(--font-mono); color: var(--text); background: var(--white) var(--i-chevron) right 14px center / 18px no-repeat;
	border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer;
}
.pp-demo-select:focus-visible { outline: 2px solid var(--blue-text); outline-offset: 2px; }

@media (max-width: 640px) {
	.pp-demo-file-head { padding: 18px 16px; }
	.pp-demo-file-actions { width: 100%; }
	.pp-demo-toggle { flex: 1; }
	.pp-demo-toggle button { flex: 1; }
	.pp-md { padding: 20px 16px 32px; font-size: 15.5px; }
	.pp-demo-raw { padding: 18px 16px; font-size: 12.5px; }
	.pp-demo-download { margin-left: 0; }
}

/* ---------- Page sections around the browser ---------- */
.is-style-pp-section.pp-demo-hero { padding-bottom: clamp(40px, 5vw, 56px); }
.pp-demo-hero .pp-section-head { margin-bottom: 0; }
.is-style-pp-section-alt.pp-demo-section { padding-top: clamp(32px, 4vw, 48px); }
