/* Aesthetic Peptides — content pages, lab-test library and calculator (P8).
 *
 * Every rule below is PORTED VERBATIM from the source's own stylesheet
 * (source-cdp/app.css) — the line ranges are noted per block. Nothing is
 * re-derived and no value is eyeballed; the design tokens it leans on
 * (--accent, --line, --radius, --display, --mono …) are declared by
 * ap-tokens.css, which P1 owns.
 *
 * ⚠️ ENQUEUE THIS SITE-WIDE. `.steps`, `.trust` and `.tools` are used by the
 * HOME page too (app.js viewHome() sections 03, 04 and 06 call the same
 * stepsBlock() / trustBlock() helpers this phase owns), so a pages-only
 * enqueue would leave the homepage unstyled in three places.
 *
 * The only non-source rules are the clearly-marked "ours" block at the end:
 * the contact form (the source page has no form) and small bits of polish that
 * the source never needed because it had no server-rendered prose.
 */

/* ---------- Steps (app.css 462-470) ---------- */

.steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1px;
	background: var(--line);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	counter-reset: step;
}
.step { padding: 30px 24px; background: rgba(8, 11, 20, 0.92); }
.step::before {
	counter-increment: step;
	content: "0" counter(step);
	display: block;
	font-family: var(--mono);
	color: var(--accent);
	font-size: 12px;
	margin-bottom: 22px;
	letter-spacing: 0.18em;
}
.step h3 { margin: 0 0 6px; font-family: var(--display); font-size: 18px; letter-spacing: 0; font-weight: 700; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Trust row (app.css 472-478) ---------- */

.trust {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 1px;
	background: var(--line);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
}
/* ⚠️ Orchestrator, integration 2026-11-16: these two were `.trust div` (descendant) here and
   `.trust > div` (direct child) in ap-home.css — same 0,1,1 specificity, so the winner depended
   on enqueue order. Normalised to the stricter child form in BOTH files. Matching is identical
   for today's markup (.trust > div.reveal holds only svg/h3/p), but the descendant form would
   have leaked onto any future nested div inside a tile. */
.trust > div { background: rgba(8, 11, 20, 0.9); padding: 28px 24px; transition: background 0.2s; }
.trust > div:hover { background: rgba(91, 143, 224, 0.045); }
.trust svg {
	width: 24px; height: 24px; fill: none; stroke: var(--accent);
	stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 14px;
}
.trust h3 { margin: 0 0 4px; font-size: 15.5px; font-weight: 700; }
.trust p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- Tool cards (app.css 775-786) ---------- */

.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tool {
	position: relative; display: flex; flex-direction: column; gap: 10px;
	padding: 28px; border-radius: var(--radius); border: 1px solid var(--line);
	background: var(--panel); overflow: hidden;
	transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.tool:hover { border-color: rgba(91, 143, 224, 0.4); transform: translateY(-3px); background: rgba(91, 143, 224, 0.04); }
.tool svg.ic { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tool:nth-child(2) svg.ic { stroke: var(--violet); }
.tool h3 { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 400; }
.tool p { margin: 0; color: var(--muted); font-size: 14px; max-width: 420px; }
.tool .go { margin-top: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-2); }

/* ---------- FAQ "Important" panel (app.css 491-530) ---------- */

.important { margin-top: 26px; }
.imp-panel {
	position: relative; overflow: hidden;
	border: 1px solid rgba(251, 191, 36, 0.24); border-radius: var(--radius);
	background: linear-gradient(180deg, rgba(251, 191, 36, 0.06), rgba(8, 11, 20, 0.88) 90px);
}
.imp-panel::before {
	content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
	background: linear-gradient(180deg, var(--warn), var(--accent));
}
.important-head {
	display: flex; align-items: center; gap: 12px; padding: 16px 22px 16px 24px;
	border-bottom: 1px solid var(--line); color: var(--text);
}
.important-head svg { width: 18px; height: 18px; fill: none; stroke: var(--warn); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.important-head b { font-family: var(--mono); font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--warn); }
.important-head span { color: var(--muted); font-size: 13px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.important ul { list-style: none; margin: 0; padding: 0; }
.important li.imp {
	display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start;
	padding: 16px 22px 16px 24px; border-top: 1px solid var(--line);
	transition: background 0.2s;
}
.important li.imp:first-child { border-top: 0; }
.important li.imp:hover { background: rgba(91, 143, 224, 0.045); }
.imp-key { display: flex; align-items: center; gap: 12px; min-width: 0; }
.imp-ic {
	flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px;
	display: grid; place-items: center;
	background: var(--accent-soft); border: 1px solid rgba(91, 143, 224, 0.28);
}
.imp-ic svg { width: 15px; height: 15px; fill: none; stroke: var(--accent-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.important li h3 {
	margin: 0; font-family: var(--mono); font-size: 11.5px; font-weight: 700;
	letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-2);
}
.important li p { margin: 0; padding-top: 5px; color: var(--text); font-size: 15px; line-height: 1.55; max-width: 75ch; }
.important li a { color: var(--text); border-bottom: 1px solid var(--accent); overflow-wrap: anywhere; }
.important li a:hover { color: var(--accent-2); }

/* ---------- Lab tests (app.css 661-693) ---------- */

.coa-table { display: flex; flex-direction: column; gap: 12px; }
.coa-row-card {
	display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: center;
	padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
	background: var(--panel);
	transition: border-color 0.2s, background 0.2s;
}
.coa-row-card:hover { border-color: var(--line-2); background: rgba(91, 143, 224, 0.04); }
.coa-product { display: flex; align-items: center; gap: 14px; min-width: 0; }
.coa-thumb {
	width: 64px; height: 64px; border-radius: 8px; overflow: hidden;
	background: #060a14; border: 1px solid var(--line); flex-shrink: 0; display: block;
}
.coa-thumb img { width: 100%; height: 100%; object-fit: cover; }
.coa-thumb .art { display: block; width: 100%; height: 100%; padding: 4px 0 0; }
.coa-name { display: block; font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--text); }
.coa-name:hover { color: var(--accent-2); }
.coa-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.coa-chip {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 9px 13px; border-radius: 6px; border: 1px solid var(--line-2);
	background: rgba(255, 255, 255, 0.03); font-size: 13px; font-weight: 600; color: var(--text);
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.coa-chip:hover { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.coa-chip svg { width: 15px; height: 15px; fill: none; stroke: var(--accent-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.coa-chip small { color: var(--dim); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }

/* Preview lightbox for the mirrored certificates */
.lightbox {
	position: fixed; inset: 0; z-index: 95; background: rgba(3, 4, 9, 0.86);
	backdrop-filter: blur(6px); display: grid; place-items: center; padding: 40px 16px;
}
.lightbox figure { margin: 0; max-width: min(1000px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 12px; }
.lightbox img { max-height: 74vh; width: auto; margin: 0 auto; border-radius: var(--radius); border: 1px solid var(--line-2); background: #fff; }
.lightbox figcaption {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	font-family: var(--mono); font-size: 12px; color: var(--body); letter-spacing: 0.06em;
}
.lightbox iframe { width: min(1000px, 100%); height: 76vh; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; }
.lightbox figcaption .hero-actions { display: inline-flex; align-items: center; gap: 12px; }

/* ---------- Reconstitution calculator (app.css 695-773) ---------- */

.calc { display: grid; grid-template-columns: 1.08fr 1fr; gap: 18px; align-items: stretch; }
.calc-inputs, .calc-output {
	border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}
.calc-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.calc-output { display: flex; flex-direction: column; gap: 16px; position: relative; overflow: hidden; }
.calc-output::before {
	content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
	background: linear-gradient(90deg, var(--accent), var(--violet));
}
.calc-inputs .note, .calc-actions { grid-column: 1 / -1; }
.calc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.input-unit { display: flex; align-items: stretch; }
.input-unit input { flex: 1; min-width: 0; border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-unit select, .input-unit .unit {
	width: auto; min-width: 70px; border-left: 0 !important;
	border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important;
}
.input-unit .unit {
	display: grid; place-items: center; padding: 0 12px; height: 44px;
	border: 1px solid var(--line-2); border-radius: 8px; color: var(--muted);
	font-family: var(--mono); font-size: 12.5px; background: rgba(255, 255, 255, 0.03);
}
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: rgba(3, 5, 11, 0.5); }
.seg button { border: 0; background: none; color: var(--muted); padding: 0 14px; height: 42px; font-size: 13px; font-weight: 600; transition: background 0.15s, color 0.15s; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg button:hover:not(.on) { color: #fff; background: rgba(255, 255, 255, 0.05); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.quick button {
	border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--body);
	border-radius: 5px; padding: 3px 9px; font-size: 11.5px; font-family: var(--mono); cursor: pointer;
}
.quick button:hover, .quick button.on { border-color: var(--accent); color: var(--accent-2); }
.calc-pick { position: relative; }
.calc-pick-hint { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 18px; }
.calc-pick-hint b { color: var(--accent-2); font-weight: 600; }

.calc-headline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.calc-headline .big { font-family: var(--display); font-size: clamp(44px, 5vw, 64px); line-height: 1; color: var(--text); letter-spacing: -0.02em; }
.calc-headline .unit { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 0.14em; text-transform: uppercase; }
.calc-sentence { color: var(--body); font-size: 14.5px; margin: 0; }
.calc-sentence b { color: var(--text); }
.calc-results {
	display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
	background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden;
}
.calc-row { background: rgba(8, 11, 20, 0.95); padding: 13px 15px; display: flex; flex-direction: column; gap: 2px; }
.calc-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.calc-value { font-family: var(--mono); font-size: 18px; color: var(--text); font-weight: 700; }
.calc-value small { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.calc-hint { font-size: 11.5px; color: var(--muted); }
.calc-warn {
	display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-s);
	background: var(--warn-soft); border: 1px solid rgba(251, 191, 36, 0.35); color: #fde68a; font-size: 13px;
}
.calc-warn[hidden] { display: none; }
.calc-warn svg { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: var(--warn); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }

/* Syringe drawing: barrel, tick marks, and a plunger that slides to the dose. */
.syringe { width: 100%; height: auto; display: block; overflow: visible; }
.syringe .barrel { fill: rgba(255, 255, 255, 0.025); stroke: var(--line-2); stroke-width: 1.2; }
.syringe .fill { fill: url(#syr-fill); transition: width 0.45s cubic-bezier(.2, .8, .2, 1); }
.syringe .fill.over { fill: rgba(248, 113, 113, 0.45); }
.syringe .tick { stroke: rgba(255, 255, 255, 0.28); stroke-width: 1; }
.syringe .tick.major { stroke: rgba(255, 255, 255, 0.55); }
.syringe .tick-label { fill: var(--muted); font-family: var(--mono); font-size: 9px; text-anchor: middle; }
.syringe .plunger { fill: #9caac2; transition: transform 0.45s cubic-bezier(.2, .8, .2, 1); }
.syringe .needle { stroke: #9caac2; stroke-width: 1.4; }
.syringe .hub { fill: rgba(255, 255, 255, 0.12); stroke: var(--line-2); }
.syringe .marker { fill: var(--accent); transition: transform 0.45s cubic-bezier(.2, .8, .2, 1); }
.syringe .marker-label {
	fill: var(--accent-2); font-family: var(--mono); font-size: 10px; font-weight: 700;
	text-anchor: middle; transition: transform 0.45s cubic-bezier(.2, .8, .2, 1);
}

/* Drag handle on the plunger. The whole syringe is draggable; the grip shows where. */
.syringe { touch-action: none; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.syringe .grip rect { fill: var(--accent); stroke: #fff; stroke-width: 1.2; filter: drop-shadow(0 2px 6px rgba(91, 143, 224, 0.6)); }
.syringe .grip path { stroke: var(--accent-ink); stroke-width: 1.4; stroke-linecap: round; fill: none; }
.syringe .grip { transition: transform 0.45s cubic-bezier(.2, .8, .2, 1); cursor: grab; }
.syringe:hover .grip rect { fill: var(--accent-2); }
.syringe:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 8px; }
/* While dragging, the plunger follows the finger with no easing lag. */
.syringe.dragging, .syringe.dragging .grip { cursor: grabbing; }
.syringe.dragging .fill, .syringe.dragging .plunger, .syringe.dragging .grip,
.syringe.dragging .marker, .syringe.dragging .marker-label { transition: none; }
.syringe-wrap { padding: 6px 4px 0; }
.calc-drag-hint {
	display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px;
	color: var(--muted); font-size: 12px; font-family: var(--mono); letter-spacing: 0.04em;
}
.calc-drag-hint svg { width: 15px; height: 15px; fill: none; stroke: var(--accent-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Calculator under a product: tighter, and lands below the sticky header when scrolled to. */
.pdp-calc { padding-top: 20px; scroll-margin-top: 90px; }
.pdp-calc .section-head { margin-bottom: 18px; }

/* ---------- Contact (app.css 805-815) ---------- */

.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; padding: 22px 0 84px; align-items: start; }
.contact-only { padding: 22px 0 84px; }
.contact-only .contact-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.contact-list { display: flex; flex-direction: column; gap: 10px; }
.contact-item {
	display: flex; gap: 14px; align-items: center; padding: 17px; border-radius: var(--radius-s);
	background: var(--panel); border: 1px solid var(--line);
	transition: border-color 0.18s, background 0.18s;
}
.contact-item:hover { border-color: rgba(91, 143, 224, 0.42); background: rgba(91, 143, 224, 0.05); }
.contact-item svg {
	width: 21px; height: 21px; fill: none; stroke: var(--accent-2);
	stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.contact-item b { display: block; font-size: 14px; color: var(--text); }
.contact-item span { color: var(--muted); font-size: 13px; word-break: break-all; }

/* ---------- OURS, not the source's ----------
 * The source has no contact form, no server-rendered prose and no batch-result
 * line on the lab-tests page. These five rules are the only additions, and they
 * are built from the same tokens so they cannot drift off-palette.
 */

.coa-result { display: block; margin-top: 4px; font-family: var(--mono); font-size: 11.5px; color: var(--accent-2); }
.ap-contact-note, .ap-compliance { margin-top: 6px; }
.ap-compliance { color: var(--dim); }
.ap-contact-form .ap-form { display: flex; flex-direction: column; gap: 16px; }
.ap-form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ap-page-prose p { color: var(--body); }
.ap-page-prose h2, .ap-page-prose h3 { font-family: var(--display); font-weight: 400; letter-spacing: -0.01em; }

/* ---------- Responsive (app.css 851-892, our selectors only) ---------- */

@media (max-width: 1000px) {
	.contact-grid, .calc { grid-template-columns: 1fr; gap: 26px; }
	.coa-row-card { grid-template-columns: 1fr; }
	.coa-links { justify-content: flex-start; }
}
@media (max-width: 720px) {
	.calc-inputs, .tools, .calc-results { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.important li.imp { grid-template-columns: 1fr; gap: 8px; padding: 14px 16px 14px 18px; }
	.important-head { padding: 14px 16px 14px 18px; flex-wrap: wrap; }
	.important li p { padding-top: 0; }
}
