/* ==========================================================================
   Grapphen Atelier: product and solutions pages (phase 2)
   Loaded after atelier.css. Uses its tokens only; adds page sections and the
   p-* product artefacts. Prefix: .pp-

   1  Page sections (plate, pair, split, directory)
   2  Artefact shared bits (labels, tables, code, notes)
   3  Artefacts, one block each
   4  Responsive
   ========================================================================== */

/* 1 Page sections --------------------------------------------------------- */

/* A full-width artefact straight under the page hero. */
.pp-plate > .at-shell { padding-top: 0; }
.pp-plate__caption {
	margin-top: 20px;
	max-width: 64ch;
	font-size: .9375rem;
	line-height: 1.55;
	color: var(--slate);
}

/* Two artefacts side by side, each with its own heading. */
.pp-pair__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 56px calc(var(--gutter) * 2.5);
	align-items: start;
}
.pp-pair__text {
	margin: 12px 0 32px;
	max-width: 46ch;
	color: var(--slate);
	text-wrap: pretty;
}

/* Two columns of facts (solutions pages). */
.pp-split__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 56px calc(var(--gutter) * 2.5);
	align-items: start;
}
.pp-split__text { margin-top: 8px; color: var(--slate); }
.pp-split__col .at-points { margin-top: 24px; }

/* Connector directory (integrations page). */
.pp-directory__list { border-top: 1px solid var(--ink); }
.pp-directory__row {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--gutter);
	row-gap: 10px;
	align-items: baseline;
	padding: 26px 0 28px;
	border-bottom: 1px solid var(--rule);
}
.pp-directory__title {
	grid-column: 1 / span 3;
	font-family: var(--font-display);
	font-size: 1.1875rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.015em;
}
.pp-directory__names {
	grid-column: 4 / span 5;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 22px;
}
.pp-directory__names li { font-weight: 500; line-height: 1.6; }
.pp-directory__desc {
	grid-column: 10 / span 3;
	font-size: .9375rem;
	line-height: 1.55;
	color: var(--slate);
}

/* Links inside answers (questions partial). */
.at-faq__answer a {
	color: var(--cobalt);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .22em;
	text-decoration-color: rgba(40, 74, 241, .35);
}
.at-faq__answer a:hover { text-decoration-color: currentColor; }

/* 2 Artefact shared bits -------------------------------------------------- */
.pp-label { margin-bottom: 8px; font-size: .75rem; color: var(--slate); }

.pp-code {
	margin: 0;
	font-family: var(--font-mono);
	font-size: .8125rem;
	line-height: 1.7;
	color: var(--ink);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	font-variant-numeric: tabular-nums;
}

.pp-table th,
.pp-table td {
	padding: 11px 10px;
	text-align: left;
	vertical-align: top;
	font-weight: 400;
}
.pp-table th:first-child, .pp-table td:first-child { padding-left: 22px; }
.pp-table th:last-child, .pp-table td:last-child { padding-right: 22px; }
.pp-table thead th {
	padding-top: 12px;
	padding-bottom: 10px;
	font-size: .75rem;
	color: var(--slate);
	white-space: nowrap;
	border-bottom: 1px solid var(--rule);
}
.pp-table tbody tr + tr { border-top: 1px solid var(--rule-soft); }
.pp-table tbody th { font-weight: 500; }
.pp-table td.at-mono { white-space: nowrap; }
.pp-table tr.is-flagged { background: var(--cobalt-wash); }
.pp-table tr.is-flagged td:last-child,
.pp-table tr.is-flagged td:last-child .at-state { color: var(--cobalt); font-weight: 500; }
.pp-table tr.is-flagged td:last-child .at-state::before { border-color: var(--cobalt); }

/* Closing line inside an artefact, on mist. */
.pp-weights__masked,
.pp-impact__note,
.pp-cadence__why,
.pp-auth__note,
.pp-checklist__next,
.pp-hook__foot {
	padding: 12px 22px;
	background: var(--mist);
	border-top: 1px solid var(--rule);
	font-size: .8125rem;
	line-height: 1.5;
	color: var(--slate);
}

/* Count or alert in an artefact head. */
.pp-board__alert {
	flex-shrink: 0;
	font-size: .8125rem;
	font-weight: 500;
	color: var(--cobalt);
	white-space: nowrap;
}

/* 3 Artefacts ------------------------------------------------------------- */

/* Stage board */
.pp-board__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--mist); }
.pp-board__cols {
	display: grid;
	grid-template-columns: repeat(4, minmax(170px, 1fr));
	min-width: 720px;
}
.pp-board__col { padding: 16px 16px 22px; }
.pp-board__col + .pp-board__col { border-left: 1px solid var(--rule); }
.pp-board__col:first-child { padding-left: 22px; }
.pp-board__col:last-child { padding-right: 22px; }
.pp-board__stage {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	font-size: .8125rem;
	font-weight: 500;
}
.pp-board__stage .at-mono { color: var(--slate); }
.pp-board__target { margin-top: 2px; font-size: .75rem; color: var(--slate); }
.pp-board__cards { display: grid; gap: 8px; margin-top: 14px; }
.pp-card {
	padding: 10px 12px 11px;
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: var(--r-btn);
}
.pp-card__name { display: block; font-size: .875rem; font-weight: 500; line-height: 1.35; }
.pp-card__row {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
	row-gap: 2px;
	margin-top: 4px;
	font-size: .75rem;
	color: var(--slate);
}
.pp-card__row .at-mono { color: var(--ink); white-space: nowrap; }
.pp-card__when { text-align: right; }
.pp-card--over { border-color: var(--cobalt); box-shadow: inset 2px 0 0 var(--cobalt); }
.pp-card--over .pp-card__when { color: var(--cobalt); font-weight: 500; }
.pp-card--done .pp-card__when { color: var(--sage-ink); font-weight: 500; }

/* Submittal settings */
.pp-toggle {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 12px 22px;
	border-bottom: 1px solid var(--rule-soft);
}
.pp-toggle__label { display: block; font-size: .875rem; font-weight: 500; line-height: 1.35; }
.pp-toggle__desc { display: block; margin-top: 1px; font-size: .75rem; color: var(--slate); }
.pp-toggle:not(.is-on) .pp-toggle__label { color: var(--slate); }
.pp-switch {
	position: relative;
	flex-shrink: 0;
	width: 30px;
	height: 18px;
	border-radius: 9px;
	background: var(--rule-strong);
}
.pp-switch::after {
	content: "";
	position: absolute;
	top: 2px; left: 2px;
	width: 14px; height: 14px;
	border-radius: 50%;
	background: var(--paper);
	box-shadow: 0 1px 2px rgba(11, 27, 51, .2);
}
.is-on .pp-switch { background: var(--ink); }
.is-on .pp-switch::after { left: 14px; }
.pp-submittal__foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px 16px;
	padding: 14px 22px 18px;
	font-size: .8125rem;
	color: var(--slate);
}
.pp-submittal__foot .at-mono { color: var(--ink); }

/* Offer letter */
.pp-offer__letter { padding: 20px 22px 18px; font-size: .875rem; line-height: 1.65; border-bottom: 1px solid var(--rule); }
.pp-offer__letter p + p { margin-top: 10px; }
.pp-offer__letter mark { white-space: nowrap; }
.pp-offer__letter mark {
	padding: 0 3px;
	border-radius: var(--r-field);
	background: var(--cobalt-wash);
	color: var(--ink);
	box-shadow: inset 0 -1px 0 rgba(40, 74, 241, .45);
}
.pp-trail { padding: 4px 22px 10px; }
.pp-trail li {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 0;
	font-size: .8125rem;
	color: var(--slate);
}
.pp-trail li + li { border-top: 1px solid var(--rule-soft); }
.pp-trail li.is-done { color: var(--sage-ink); font-weight: 500; }

/* Boolean builder */
.pp-boolean__part { padding: 18px 22px 20px; }
.pp-boolean__part--out { background: var(--mist); border-top: 1px solid var(--rule); }
.pp-boolean__brief {
	padding: 11px 13px;
	border: 1px solid var(--rule-strong);
	border-radius: var(--r-field);
	font-size: .9375rem;
	line-height: 1.5;
}

/* Sources */
.pp-sources__merge {
	padding: 12px 22px;
	border-top: 1px solid var(--rule);
	font-size: .8125rem;
	color: var(--slate);
}
.pp-sources__merge .at-mono { color: var(--ink); font-weight: 500; }

/* Ownership lock */
.pp-facts > div {
	display: grid;
	grid-template-columns: 11rem 1fr;
	gap: 4px 16px;
	padding: 11px 22px;
	font-size: .8125rem;
}
.pp-facts > div + div { border-top: 1px solid var(--rule-soft); }
.pp-facts dt { color: var(--slate); }
.pp-facts dd { font-weight: 500; }

/* Fit score weights */
.pp-weights__total { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.pp-weights__total .at-mono { font-size: 2rem; font-weight: 500; line-height: 1; letter-spacing: -0.04em; }
.pp-weights__total span:last-child { margin-top: 6px; font-size: .75rem; color: var(--slate); }
.pp-weights__table tbody th { width: 100%; }
.pp-weights__name { display: block; }
.pp-weights__why { display: block; margin-top: 2px; font-size: .75rem; font-weight: 400; color: var(--slate); }
.pp-meter { position: relative; display: block; height: 2px; margin-top: 10px; background: var(--rule-soft); }
.pp-meter::after {
	content: "";
	position: absolute; left: 0; top: 0; bottom: 0;
	width: calc(var(--fill, 0) * 100%);
	background: var(--ink);
}

/* Text thread */
.pp-thread__list { display: flex; flex-direction: column; gap: 10px; padding: 18px 22px 20px; }
.pp-msg { max-width: 84%; padding: 10px 14px 8px; font-size: .875rem; line-height: 1.5; }
.pp-msg--out { align-self: flex-end; background: var(--cobalt-wash); border-radius: 12px 12px 3px 12px; }
.pp-msg--in { align-self: flex-start; background: var(--mist); border-radius: 12px 12px 12px 3px; }
.pp-msg__time { display: block; margin-top: 4px; font-size: .6875rem; color: var(--slate); }
.pp-msg--out .pp-msg__time { text-align: right; }
.pp-msg__link {
	display: inline-block;
	margin-top: 8px;
	padding: 5px 10px;
	border: 1px solid rgba(40, 74, 241, .3);
	border-radius: var(--r-btn);
	background: var(--paper);
	font-size: .75rem;
	font-weight: 500;
	color: var(--cobalt);
}
.pp-suite .at-suite__item:last-child { border-bottom: 0; }
.pp-thread__consent {
	padding: 10px 22px 14px;
	border-top: 1px solid var(--rule-soft);
	font-size: .75rem;
	line-height: 1.5;
	color: var(--slate);
}

/* Sequence */
.pp-step {
	display: grid;
	grid-template-columns: 24px 1fr auto;
	gap: 14px;
	align-items: start;
	padding: 14px 22px;
}
.pp-step + .pp-step { border-top: 1px solid var(--rule-soft); }
.pp-step__n {
	display: grid;
	place-items: center;
	width: 24px; height: 24px;
	border: 1px solid var(--rule-strong);
	border-radius: 50%;
	font-size: .6875rem;
	color: var(--slate);
}
.pp-step--done .pp-step__n { border-color: var(--sage); color: var(--sage-ink); }
.pp-step__what { display: block; font-size: .875rem; line-height: 1.45; }
.pp-step__what strong { font-weight: 500; }
.pp-step__when { display: block; margin-top: 2px; font-size: .75rem; color: var(--slate); }
.pp-step__what { font-weight: 500; }
.pp-step--wait .pp-step__what { color: var(--slate); text-decoration: line-through; text-decoration-color: var(--rule-strong); }
.pp-step .at-state { padding-top: 2px; }

/* Onboarding checklist */
.pp-checklist__count { flex-shrink: 0; font-size: .8125rem; color: var(--slate); white-space: nowrap; }
.pp-checklist__count .at-mono { color: var(--ink); font-weight: 500; }
.pp-check {
	display: grid;
	grid-template-columns: 16px 1fr auto;
	gap: 14px;
	align-items: center;
	padding: 13px 22px;
}
.pp-check + .pp-check { border-top: 1px solid var(--rule-soft); }
.pp-check__box {
	position: relative;
	width: 16px; height: 16px;
	border: 1.5px solid var(--rule-strong);
	border-radius: var(--r-field);
}
.pp-check--done .pp-check__box { background: var(--sage); border-color: var(--sage); }
.pp-check--done .pp-check__box::after {
	content: "";
	position: absolute;
	left: 4px; top: 1px;
	width: 4px; height: 8px;
	border-right: 1.5px solid #fff;
	border-bottom: 1.5px solid #fff;
	transform: rotate(45deg);
}
.pp-check__label { display: block; font-size: .875rem; font-weight: 500; line-height: 1.35; }
.pp-check__desc { display: block; margin-top: 1px; font-size: .75rem; color: var(--slate); }

/* Webhook delivery */
.pp-hook__bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 12px 22px;
	background: var(--mist);
	border-bottom: 1px solid var(--rule);
	font-size: .8125rem;
}
.pp-hook__headers > div {
	display: grid;
	grid-template-columns: 11.5rem 1fr;
	gap: 2px 12px;
	padding: 9px 22px;
	border-bottom: 1px solid var(--rule-soft);
	font-size: .75rem;
}
.pp-hook__headers dt { color: var(--slate); }
.pp-hook__headers dd { overflow-wrap: anywhere; }
.pp-hook__body { padding: 16px 22px 18px; }

/* Spread */
.pp-spread__math tbody th { color: var(--slate); font-weight: 400; }
.pp-spread__math tfoot th,
.pp-spread__math tfoot td {
	padding: 13px 10px 14px;
	border-top: 1px solid var(--ink);
	font-weight: 600;
	text-align: left;
}
.pp-spread__math tfoot th { padding-left: 22px; }
.pp-spread__math tfoot td { padding-right: 22px; font-size: 1rem; }

/* Approval chain and band */
.pp-chain__step {
	display: grid;
	grid-template-columns: 1fr auto 5.5rem;
	gap: 16px;
	align-items: center;
	padding: 12px 22px;
}
.pp-chain__step + .pp-chain__step { border-top: 1px solid var(--rule-soft); }
.pp-chain__who { font-size: .875rem; font-weight: 500; }
.pp-chain__when { font-size: .75rem; color: var(--slate); text-align: right; }
.pp-band { padding: 16px 22px 18px; background: var(--mist); border-top: 1px solid var(--rule); }
.pp-band__head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; font-size: .8125rem; color: var(--slate); }
.pp-band__head .at-mono { color: var(--ink); font-weight: 500; }
.pp-band__track {
	position: relative;
	height: 6px;
	margin: 14px 0 12px;
	background: var(--paper);
	border: 1px solid var(--rule-strong);
	border-radius: 3px;
}
.pp-band__mark {
	position: absolute;
	top: -6px;
	left: calc(var(--at, .5) * 100%);
	width: 2px; height: 16px;
	margin-left: -1px;
	background: var(--cobalt);
}
.pp-band__note { font-size: .8125rem; color: var(--slate); }
.pp-band__note .at-mono { color: var(--ink); font-weight: 500; }

/* 4 Responsive ------------------------------------------------------------ */
@media (max-width: 1079px) {
	.pp-pair__grid,
	.pp-split__grid { grid-template-columns: 1fr; }
	.pp-pair__item .at-artefact { max-width: 620px; }
	.pp-directory__title { grid-column: 1 / -1; }
	.pp-directory__names { grid-column: 1 / span 7; }
	.pp-directory__desc { grid-column: 8 / span 5; }
}

@media (max-width: 760px) {
	.pp-directory__names,
	.pp-directory__desc { grid-column: 1 / -1; }
	.pp-directory__names { gap: 2px 18px; }
}

@media (max-width: 480px) {
	.pp-toggle, .pp-submittal__foot, .pp-offer__letter, .pp-trail,
	.pp-boolean__part, .pp-sources__merge, .pp-facts > div,
	.pp-thread__list, .pp-thread__consent, .pp-step, .pp-check,
	.pp-hook__bar, .pp-hook__headers > div, .pp-hook__body,
	.pp-chain__step, .pp-band,
	.pp-weights__masked, .pp-impact__note, .pp-cadence__why,
	.pp-auth__note, .pp-checklist__next, .pp-hook__foot { padding-inline: 18px; }
	.pp-table th:first-child, .pp-table td:first-child,
	.pp-spread__math tfoot th { padding-left: 18px; }
	.pp-table th:last-child, .pp-table td:last-child,
	.pp-spread__math tfoot td { padding-right: 18px; }
	.pp-table th, .pp-table td { padding-inline: 7px; }
	.pp-board__col:first-child { padding-left: 18px; }
	.pp-facts > div,
	.pp-hook__headers > div { grid-template-columns: 1fr; }
	.pp-chain__step { grid-template-columns: 1fr auto; }
	.pp-chain__when { grid-column: 1 / -1; text-align: left; margin-top: -10px; }
	.pp-msg { max-width: 92%; }
}

/* 5 Phone fixes (2026-11-11) ---------------------------------------------
   The stage board kept a 720px minimum, so phones showed two of four stages
   with no hint that more existed. It now wraps to a 2 x 2 grid. Status and
   date cells in artefact tables could not wrap and were clipped at 390px. */
@media (max-width: 760px) {
	.pp-board__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; }
	.pp-board__col,
	.pp-board__col:first-child,
	.pp-board__col:last-child { padding: 14px 14px 18px; }
	.pp-board__col:nth-child(odd) { border-left: 0; }
	.pp-board__col:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 560px) {
	.pp-table { font-size: .8125rem; }
	.pp-table td.at-mono { white-space: normal; }
	.pp-table .at-state { white-space: normal; align-items: baseline; }
	.pp-table .at-state::before { transform: translateY(-1px); }
}
@media (max-width: 380px) {
	.pp-board__cols { grid-template-columns: 1fr; }
	.pp-board__col + .pp-board__col { border-left: 0; border-top: 1px solid var(--rule); }
}
