/*
 * pH Adjustment Calculator.
 *
 * Every rule is prefixed `body.pha-page` so it outranks ruki-child's
 * `.t33-page-main .entry-content a / h1..h6 / input` rules at (0,3,1).
 * No !important. The shared tool-page shell is spliced in at the end of this
 * file by ../_shared/sync-shell.js; do not edit inside its markers.
 * Colours are custom properties on .pha, so the chart and the scale follow them.
 * `font: ... inherit` is invalid shorthand: font-family is always its own line.
 */

body.pha-page .pha {
	--pha-ink: #1b2233;
	--pha-soft: #5a6378;
	--pha-faint: #8b93a7;
	--pha-cyan: #2bc8e8;
	--pha-cyan-d: #0f8fab;
	--pha-coral: #f67280;
	--pha-coral-d: #d9485b;
	--pha-navy: #0d1430;
	--pha-line: #e3e7ef;
	--pha-wash: #f5f8fc;
	--pha-err: #c23b4a;
	--pha-amber: #e8a317;
	--pha-card: #fff;
	position: relative;
	background: var(--pha-card);
	color: var(--pha-ink);
	border-radius: 18px;
	padding: 22px 24px 22px;
	margin: 0 auto 2.2em;
	max-width: 980px;
	font-size: 16px;
	line-height: 1.5;
	box-sizing: border-box;
}

body.pha-page .pha *,
body.pha-page .pha *::before,
body.pha-page .pha *::after {
	box-sizing: border-box;
}

body.pha-page .pha [hidden] {
	display: none;
}

body.pha-page .pha button {
	font-family: inherit;
	cursor: pointer;
}

/* ------------------------------------------------------------ context chips */

body.pha-page .pha .pha-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 20px;
}

body.pha-page .pha .pha-ctx {
	min-height: 46px;
	margin: 0;
	padding: 8px 20px;
	border: 1.5px solid var(--pha-line);
	border-radius: 999px;
	background: var(--pha-card);
	color: var(--pha-ink);
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.2;
	transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

body.pha-page .pha .pha-ctx:hover {
	border-color: var(--pha-cyan);
}

body.pha-page .pha .pha-ctx.is-on {
	border-color: var(--pha-navy);
	background: var(--pha-navy);
	color: #fff;
}

body.pha-page .pha .pha-ctx:focus-visible {
	outline: 3px solid rgba(43, 200, 232, 0.55);
	outline-offset: 2px;
}

/* ----------------------------------------------------------------- main */

body.pha-page .pha .pha-main {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	grid-template-areas:
		"top right"
		"bot right";
	grid-template-rows: auto 1fr;
	gap: 18px 26px;
	align-items: start;
}

/* the form wrappers vanish so its two halves can sit on either side of the result on phones */
body.pha-page .pha .pha-left,
body.pha-page .pha .pha-form {
	display: contents;
}

body.pha-page .pha .pha-ftop { grid-area: top; min-width: 0; }
body.pha-page .pha .pha-fbot { grid-area: bot; min-width: 0; }
body.pha-page .pha .pha-right { grid-area: right; min-width: 0; }

body.pha-page .pha .pha-fpart > * + * {
	margin-top: 14px;
}

body.pha-page .pha .pha-three {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	align-items: end;
}

/* the sub-tabs sit inside the form */
body.pha-page .pha .pha-fbot > .pha-tabs + .pha-panelbox {
	margin-top: 10px;
}

body.pha-page .pha .pha-panelbox {
	padding: 14px;
	border: 1.5px solid var(--pha-line);
	border-radius: 12px;
	background: var(--pha-card);
}

body.pha-page .pha .pha-panelbox > * + * {
	margin-top: 12px;
}

body.pha-page .pha .pha-note {
	margin: 0;
	color: var(--pha-soft);
	font-size: 0.86rem;
	line-height: 1.45;
}

/* -------------------------------------------------------------- pH scale */

body.pha-page .pha .pha-scale {
	margin: 2px 0 8px;
}

body.pha-page .pha .pha-flags {
	position: relative;
	height: 30px;
}

body.pha-page .pha .pha-flag {
	--c: var(--pha-navy);
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	white-space: nowrap;
	transition: left 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

body.pha-page .pha .pha-flag-tgt { --c: var(--pha-coral-d); }
body.pha-page .pha .pha-flag.is-l { transform: translateX(-100%); }
body.pha-page .pha .pha-flag.is-r { transform: none; }
body.pha-page .pha .pha-flag.is-off { visibility: hidden; }

body.pha-page .pha .pha-flag b {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 8px;
	background: var(--c);
	color: #fff;
	font-size: 0.76rem;
	font-weight: 800;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
}

body.pha-page .pha .pha-flag::after {
	content: "";
	position: absolute;
	bottom: -4px;
	left: 50%;
	margin-left: -5px;
	border: 5px solid transparent;
	border-top-color: var(--c);
	border-bottom: 0;
}

body.pha-page .pha .pha-flag.is-l::after { left: auto; right: -5px; margin-left: 0; }
body.pha-page .pha .pha-flag.is-r::after { left: -5px; margin-left: 0; }

body.pha-page .pha .pha-bar {
	position: relative;
	height: 18px;
	margin-top: 6px;
	border-radius: 9px;
	background: linear-gradient(90deg, #e8433b 0%, #f2762e 14%, #f7b731 28%, #d9d92a 40%, #8ccf3a 50%, #3fb55f 57%, #26b3a5 64%, #2c92d6 76%, #4a62c9 88%, #7a4cb5 100%);
}

body.pha-page .pha .pha-band {
	position: absolute;
	top: 0;
	bottom: 0;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.45);
	box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.95);
}

body.pha-page .pha .pha-band.is-off { display: none; }

body.pha-page .pha .pha-pin {
	position: absolute;
	top: -4px;
	width: 5px;
	height: 26px;
	margin-left: -2.5px;
	border-radius: 3px;
	background: var(--pha-navy);
	box-shadow: 0 0 0 2px #fff;
	transition: left 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

body.pha-page .pha .pha-pin-tgt { background: var(--pha-coral-d); }
body.pha-page .pha .pha-pin.is-off { visibility: hidden; }

body.pha-page .pha .pha-ticks {
	position: relative;
	height: 20px;
	margin-top: 5px;
}

body.pha-page .pha .pha-ticks span {
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	color: var(--pha-soft);
	font-size: 0.74rem;
	font-weight: 700;
}

body.pha-page .pha .pha-ticks span:first-child { transform: none; }
body.pha-page .pha .pha-ticks span:last-child { transform: translateX(-100%); }

body.pha-page .pha .pha-scale-k {
	margin-bottom: 2px;
	display: flex;
	justify-content: space-between;
	color: var(--pha-faint);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* ----------------------------------------------------------------- tabs */

body.pha-page .pha .pha-tabs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
	margin: 0;
	padding: 5px;
	border-radius: 14px;
	background: var(--pha-wash);
}

body.pha-page .pha .pha-tab {
	min-height: 48px;
	margin: 0;
	padding: 8px 8px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--pha-soft);
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.2;
	transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

body.pha-page .pha .pha-tab:hover {
	color: var(--pha-ink);
}

body.pha-page .pha .pha-tab.is-on {
	background: #fff;
	color: var(--pha-navy);
	box-shadow: 0 2px 10px rgba(13, 20, 48, 0.14), 0 0 0 2px rgba(43, 200, 232, 0.5);
}

body.pha-page .pha .pha-tab:focus-visible,
body.pha-page .pha .pha-chip:focus-visible,
body.pha-page .pha .pha-btn:focus-visible,
body.pha-page .pha .pha-segb:focus-visible,
body.pha-page .pha summary:focus-visible {
	outline: 3px solid rgba(43, 200, 232, 0.55);
	outline-offset: 2px;
}

body.pha-page .pha .pha-field {
	display: block;
	margin: 0;
	min-width: 0;
}

body.pha-page .pha .pha-label {
	display: block;
	margin-bottom: 5px;
	color: var(--pha-soft);
	font-size: 0.84rem;
	font-weight: 700;
}

body.pha-page .pha .pha-two {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	align-items: start;
}

body.pha-page .pha .pha-inwrap {
	position: relative;
	display: block;
}

body.pha-page .pha .pha-input,
body.pha-page .pha .pha-select {
	display: block;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 12px;
	border: 1.5px solid #cdd4e1;
	border-radius: 10px;
	background-color: #fff;
	color: var(--pha-ink);
	font-family: inherit;
	font-size: 1.02rem;
	font-weight: 600;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}

body.pha-page .pha .pha-inwrap .pha-input {
	padding-right: 52px;
}

body.pha-page .pha .pha-select {
	padding-right: 32px;
	font-size: 0.95rem;
	font-weight: 500;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235a6378' stroke-width='1.8'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	text-overflow: ellipsis;
}

body.pha-page .pha .pha-input:focus,
body.pha-page .pha .pha-select:focus {
	outline: none;
	border-color: var(--pha-cyan);
	box-shadow: 0 0 0 3px rgba(43, 200, 232, 0.25);
}

body.pha-page .pha .pha-input.is-bad {
	border-color: var(--pha-err);
	box-shadow: 0 0 0 3px rgba(194, 59, 74, 0.14);
}

body.pha-page .pha .pha-suffix {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	color: var(--pha-faint);
	font-size: 0.9rem;
	font-weight: 600;
	pointer-events: none;
}

body.pha-page .pha .pha-hint {
	display: block;
	margin-top: 4px;
	color: var(--pha-faint);
	font-size: 0.78rem;
	line-height: 1.35;
}

body.pha-page .pha .pha-note {
	margin: 0;
}

body.pha-page .pha .pha-flow {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 118px;
	gap: 6px;
}

/* segmented control */

body.pha-page .pha .pha-seg {
	display: inline-flex;
	max-width: 100%;
	padding: 3px;
	border-radius: 999px;
	background: #e6edf5;
}

body.pha-page .pha .pha-segb {
	min-height: 42px;
	margin: 0;
	padding: 6px 14px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--pha-soft);
	font-size: 0.86rem;
	font-weight: 700;
	line-height: 1.2;
	transition: background-color 0.2s, color 0.2s;
}

body.pha-page .pha .pha-segb.is-on {
	background: #fff;
	color: var(--pha-navy);
	box-shadow: 0 1px 4px rgba(13, 20, 48, 0.14);
}


/* chips */

body.pha-page .pha .pha-presets {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

body.pha-page .pha .pha-presets-l {
	margin-right: 2px;
	color: var(--pha-soft);
	font-size: 0.8rem;
	font-weight: 700;
}

body.pha-page .pha .pha-chip {
	min-height: 36px;
	margin: 0;
	padding: 6px 12px;
	border: 1.5px solid var(--pha-line);
	border-radius: 999px;
	background: #fff;
	color: var(--pha-ink);
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.2;
	transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}

body.pha-page .pha .pha-chip:hover {
	border-color: var(--pha-cyan);
	background: #ecfaff;
	transform: translateY(-1px);
}

/* disclosure inside the form */

body.pha-page .pha .pha-more {
	border: 1.5px solid var(--pha-line);
	border-radius: 12px;
	background: #fff;
}

body.pha-page .pha .pha-more summary {
	position: relative;
	padding: 12px 40px 12px 14px;
	color: var(--pha-navy);
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.3;
	cursor: pointer;
	list-style: none;
}

body.pha-page .pha .pha-more summary::-webkit-details-marker {
	display: none;
}

body.pha-page .pha .pha-more summary::after,
body.pha-page .pha .pha-panel summary::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 16px;
	width: 9px;
	height: 9px;
	margin-top: -6px;
	border-right: 2px solid var(--pha-soft);
	border-bottom: 2px solid var(--pha-soft);
	transform: rotate(45deg);
	transition: transform 0.25s;
}

body.pha-page .pha .pha-more[open] summary::after,
body.pha-page .pha .pha-panel[open] summary::after {
	margin-top: -2px;
	transform: rotate(225deg);
}

body.pha-page .pha .pha-more-b {
	padding: 0 14px 14px;
}

body.pha-page .pha .pha-more-b > * + * {
	margin-top: 10px;
}

/* ------------------------------------------------------------- results */

body.pha-page .pha .pha-hero {
	padding: 18px 20px 20px;
	border-radius: 16px;
	background: linear-gradient(135deg, #0d1430 0%, #17306a 100%);
	color: #fff;
	box-shadow: 0 10px 26px rgba(13, 20, 48, 0.22);
}

body.pha-page .pha .pha-kpi-l {
	display: block;
	color: #9fdcf0;
	font-size: 0.88rem;
	font-weight: 700;
	line-height: 1.35;
}

body.pha-page .pha .pha-answer {
	margin: 8px 0 0;
	color: #fff;
	font-size: 1.45rem;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

body.pha-page .pha .pha-answer strong {
	color: #7fe3f7;
	font-size: 2.1rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

body.pha-page .pha .pha-alt {
	color: #cfe4f3;
	font-size: 1.1rem;
	font-weight: 600;
}

body.pha-page .pha .pha-sub {
	margin: 8px 0 0;
	color: #cfe4f3;
	font-size: 0.88rem;
	line-height: 1.45;
}

body.pha-page .pha .pha-info {
	margin: 12px 0 0;
	padding: 9px 14px;
	border-left: 4px solid var(--pha-cyan);
	border-radius: 0 10px 10px 0;
	background: var(--pha-wash);
	color: var(--pha-soft);
	font-size: 0.84rem;
	line-height: 1.45;
}

body.pha-page .pha .pha-warn {
	margin: 12px 0 0;
	padding: 10px 14px;
	border-left: 4px solid var(--pha-coral);
	border-radius: 0 10px 10px 0;
	background: #fff5f6;
	color: #7a2833;
	font-size: 0.86rem;
	line-height: 1.45;
}

body.pha-page .pha .pha-facts {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 8px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

body.pha-page .pha .pha-facts li {
	display: flex;
	flex-direction: column;
	gap: 1px;
	margin: 0;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--pha-wash);
	color: var(--pha-soft);
	font-size: 0.82rem;
}

body.pha-page .pha .pha-facts li::before {
	content: none;
}

body.pha-page .pha .pha-tile-l {
	color: var(--pha-soft);
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

body.pha-page .pha .pha-facts strong {
	color: var(--pha-navy);
	font-size: 1.05rem;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

body.pha-page .pha .pha-facts small {
	color: var(--pha-soft);
	font-size: 0.8rem;
	line-height: 1.4;
}

body.pha-page .pha .pha-out.is-err {
	padding: 16px 18px;
	border: 1.5px solid #f2c6cc;
	border-radius: 14px;
	background: #fff5f6;
	color: var(--pha-err);
}

body.pha-page .pha .pha-err-h {
	margin: 0 0 4px;
	font-weight: 800;
}

body.pha-page .pha .pha-errs {
	margin: 0 0 12px;
	padding-left: 18px;
}

body.pha-page .pha .pha-errs:last-child {
	margin-bottom: 0;
}

body.pha-page .pha .pha-safety {
	margin: 12px 0 0;
	padding: 9px 12px;
	border-left: 4px solid var(--pha-amber);
	border-radius: 0 10px 10px 0;
	background: #fff9ea;
	color: #5c4710;
	font-size: 0.8rem;
	line-height: 1.4;
}

body.pha-page .pha .pha-safety strong {
	margin-right: 4px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* --------------------------------------------------------------- chart */

body.pha-page .pha .pha-curvebox,
body.pha-page .pha .pha-mathbox {
	margin: 16px 0 0;
}

body.pha-page .pha .pha-chart-h {
	margin: 0 0 6px;
	color: var(--pha-navy);
	font-size: 0.96rem;
	font-weight: 800;
}

body.pha-page .pha .pha-chart-svg {
	display: block;
	width: 100%;
	height: auto;
}

body.pha-page .pha .pha-grid { stroke: var(--pha-line); stroke-width: 1; }
body.pha-page .pha .pha-grid-v { stroke: #eef1f6; }
body.pha-page .pha .pha-ax-t { fill: var(--pha-soft); font-family: inherit; font-size: 12.5px; font-weight: 600; }
body.pha-page .pha .pha-ax-title { fill: var(--pha-soft); font-family: inherit; font-size: 12.5px; font-weight: 700; }
body.pha-page .pha .pha-curve { fill: none; stroke: var(--pha-cyan-d); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
body.pha-page .pha .pha-ref { stroke-width: 1.4; stroke-dasharray: 5 5; }
body.pha-page .pha .pha-ref-now { stroke: var(--pha-navy); }
body.pha-page .pha .pha-ref-tgt { stroke: var(--pha-coral-d); }
body.pha-page .pha .pha-ref-t { font-family: inherit; font-size: 12px; font-weight: 700; }
body.pha-page .pha .pha-ref-t-now { fill: var(--pha-navy); }
body.pha-page .pha .pha-ref-t-tgt { fill: var(--pha-coral-d); }
body.pha-page .pha .pha-mark-l { stroke: var(--pha-coral); stroke-width: 1.5; stroke-dasharray: 3 4; }
body.pha-page .pha .pha-mark-c { fill: var(--pha-coral); stroke: var(--pha-card); stroke-width: 3; }
body.pha-page .pha .pha-mark-t {
	fill: var(--pha-navy);
	stroke: var(--pha-card);
	stroke-width: 4px;
	paint-order: stroke;
	font-family: inherit;
	font-size: 13px;
	font-weight: 800;
}

/* -------------------------------------------------------------- panels */

body.pha-page .pha .pha-panel {
	margin: 14px 0 0;
	border: 1.5px solid var(--pha-line);
	border-radius: 14px;
	background: #fff;
}

body.pha-page .pha .pha-panel summary {
	position: relative;
	padding: 14px 44px 14px 16px;
	color: var(--pha-navy);
	font-weight: 700;
	cursor: pointer;
	list-style: none;
}

body.pha-page .pha .pha-panel summary::-webkit-details-marker {
	display: none;
}

body.pha-page .pha .pha-panel-b {
	padding: 0 16px 16px;
}

body.pha-page .pha .pha-steps {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: phastep;
}

body.pha-page .pha .pha-step {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 10px 0 10px 40px;
	border-bottom: 1px dashed var(--pha-line);
	counter-increment: phastep;
	font-variant-numeric: tabular-nums;
}

body.pha-page .pha .pha-step:last-child {
	border-bottom: 0;
}

body.pha-page .pha .pha-step::before {
	content: counter(phastep);
	position: absolute;
	top: 10px;
	left: 0;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #ecfaff;
	color: var(--pha-cyan-d);
	font-size: 0.82rem;
	font-weight: 800;
	line-height: 26px;
	text-align: center;
}

body.pha-page .pha .pha-step-l {
	color: var(--pha-navy);
	font-weight: 700;
}

body.pha-page .pha .pha-step-f {
	color: var(--pha-soft);
	font-size: 0.92rem;
	overflow-wrap: anywhere;
}

body.pha-page .pha .pha-step-s,
body.pha-page .pha .pha-step-r {
	font-size: 0.92rem;
	overflow-wrap: anywhere;
}

body.pha-page .pha .pha-muted {
	margin: 0 0 8px;
	color: var(--pha-soft);
	font-size: 0.86rem;
}

/* ------------------------------------------------------------- actions */

body.pha-page .pha .pha-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
}

body.pha-page .pha .pha-btn {
	min-height: 44px;
	margin: 0;
	padding: 10px 16px;
	border: 1.5px solid #cdd4e1;
	border-radius: 10px;
	background: #fff;
	color: var(--pha-navy);
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.2;
	transition: border-color 0.2s, background-color 0.2s, transform 0.15s;
}

body.pha-page .pha .pha-btn:hover {
	border-color: var(--pha-cyan);
	transform: translateY(-1px);
}

body.pha-page .pha .pha-btn-p {
	border-color: var(--pha-navy);
	background: var(--pha-navy);
	color: #fff;
}

body.pha-page .pha .pha-btn-p:hover {
	background: #17306a;
	border-color: #17306a;
}

body.pha-page .pha .pha-btn-s {
	min-height: 38px;
	padding: 6px 14px;
	font-size: 0.84rem;
}

body.pha-page .pha .pha-toast {
	color: #1f8a5b;
	font-size: 0.88rem;
	font-weight: 700;
	opacity: 0;
	transition: opacity 0.3s;
}

body.pha-page .pha .pha-toast.is-on {
	opacity: 1;
}

/* ------------------------------------------------------------- phones */

@media (max-width: 860px) {
	body.pha-page .pha .pha-main {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: none;
		grid-template-areas:
			"top"
			"right"
			"bot";
	}
}

@media (max-width: 560px) {
	body.pha-page .pha {
		padding: 14px 12px 16px;
		border-radius: 14px;
	}
	body.pha-page .pha .pha-chips {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	body.pha-page .pha .pha-ctx {
		padding: 8px 8px;
		font-size: 0.9rem;
	}
	body.pha-page .pha .pha-three {
		grid-template-columns: minmax(0, 1fr);
	}
	body.pha-page .pha .pha-tab {
		font-size: 0.86rem;
		padding: 6px 4px;
	}
	body.pha-page .pha .pha-answer {
		font-size: 1.2rem;
	}
	body.pha-page .pha .pha-answer strong {
		font-size: 1.8rem;
	}
	body.pha-page .pha .pha-hero {
		padding: 14px 14px 16px;
	}
	body.pha-page .pha .pha-panelbox {
		padding: 12px 10px;
	}
	body.pha-page .pha .pha-flag b {
		padding: 3px 7px;
		font-size: 0.72rem;
	}
	body.pha-page .pha .pha-ax-t,
	body.pha-page .pha .pha-ax-title {
		font-size: 21px;
	}
	body.pha-page .pha .pha-ref-t {
		font-size: 19px;
	}
	body.pha-page .pha .pha-mark-t {
		font-size: 21px;
		stroke-width: 6px;
	}
	body.pha-page .pha .pha-actions .pha-btn {
		flex: 1 1 calc(50% - 8px);
	}
	body.pha-page .pha .pha-actions .pha-toast {
		flex: 1 1 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.pha-page .pha *,
	body.pha-page .pha *::before,
	body.pha-page .pha *::after,
	body.pha-page .pha [class],
	body.pha-page .pha [class]::before,
	body.pha-page .pha [class]::after,
	body.pha-page .pha .pha-more summary::after,
	body.pha-page .pha .pha-panel summary::after {
		animation: none;
		transition: none;
	}
}

/* ------------------------------------------------- article + tables */

/* ------------------------------------------------------------- article */

body.pha-page .entry-content .pha-figure {
	margin: 1.8em 0;
}

body.pha-page .entry-content .pha-figure img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	border-radius: 14px;
}

body.pha-page .entry-content .pha-figure figcaption {
	margin-top: 8px;
	color: #6b7388;
	font-size: 0.86rem;
	text-align: center;
}

body.pha-page .entry-content .pha-table {
	width: 100%;
	margin: 1.2em 0 1.6em;
	border-collapse: collapse;
	font-size: 0.95rem;
}

body.pha-page .entry-content .pha-table th,
body.pha-page .entry-content .pha-table td {
	display: table-cell;
	padding: 9px 12px;
	border: 0;
	border-bottom: 1px solid #e3e7ef;
	text-align: left;
	color: #1b2233;
}

body.pha-page .entry-content .pha-table th {
	background: #0d1430;
	color: #fff;
	font-size: 0.82rem;
	font-weight: 700;
}

body.pha-page .entry-content .pha-table td + td,
body.pha-page .entry-content .pha-table th + th {
	text-align: right;
}

/* ------------------------------------------------- article tables + gear */

/* Tables and the gear box are not in the enumerated prose measure above, so
 * they get the same 760px column here (same (0,3,2) weight). */
body.pha-page .t33-page-main .entry-content > :is(table.pha-table, div.pha-gear) {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}

body.pha-page .entry-content .pha-table tbody tr:nth-child(even) td {
	background: #f6f8fb;
}

body.pha-page .entry-content .pha-gear {
	display: grid;
	gap: 14px;
	margin: 1.4em auto 0.6em;
}

body.pha-page .entry-content .pha-gear-card {
	display: grid;
	grid-template-columns: 140px minmax(0, 1fr);
	gap: 18px;
	align-items: center;
	padding: 16px 18px;
	border: 1px solid #e3e7ef;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(13, 20, 48, 0.06);
}

body.pha-page .entry-content .pha-gear-card > p:empty {
	display: none;
}

body.pha-page .entry-content .pha-gear-img {
	grid-column: 1;
	grid-row: 1;
	margin: 0;
}

body.pha-page .entry-content .pha-gear-img img {
	display: block;
	width: 140px;
	height: 140px;
	object-fit: contain;
	border-radius: 10px;
	background: #fff;
}

body.pha-page .entry-content .pha-gear-body {
	grid-column: 2;
	grid-row: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

body.pha-page .entry-content .pha-gear-kind {
	color: #0e8aa8;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

body.pha-page .entry-content .pha-gear-name {
	color: #0d1430;
	font-size: 1.08rem;
	font-weight: 800;
	line-height: 1.3;
}

body.pha-page .entry-content .pha-gear-text {
	color: #3a4258;
	font-size: 0.94rem;
	line-height: 1.55;
}

body.pha-page .t33-page-main .entry-content a.pha-gear-btn {
	margin-top: 8px;
	padding: 9px 16px;
	border-radius: 999px;
	background: #0d1430;
	color: #fff;
	font-size: 0.88rem;
	font-weight: 700;
	text-decoration: none;
}

body.pha-page .t33-page-main .entry-content a.pha-gear-btn:hover {
	background: #0e8aa8;
}

body.pha-page .entry-content .pha-gear-note {
	color: #6b7388;
	font-size: 0.82rem;
}

@media (max-width: 640px) {
	body.pha-page .entry-content .pha-gear-card {
		grid-template-columns: 96px minmax(0, 1fr);
		gap: 12px;
		padding: 14px;
		align-items: start;
	}
	body.pha-page .entry-content .pha-gear-img img {
		width: 96px;
		height: 96px;
	}
	body.pha-page .entry-content .pha-table {
		font-size: 0.85rem;
	}
	body.pha-page .entry-content .pha-table th,
	body.pha-page .entry-content .pha-table td {
		padding: 8px 6px;
	}
}

/* >>> t33 tool-page shell v1 (generated - edit _shared/toolpage-shell.css) */

/*
 * Makes the lift the card's own. Without a block formatting context the card's
 * negative margin collapses out through `.entry-content`, `article` and
 * `.t33-page-main` -- none of which has top padding -- and lands on `.wrap`,
 * moving the entire column instead of the one element. Measured on the live
 * page before this line existed: `.wrap` top and card top were both 300px, so
 * the declared -72px was in effect on the wrong element and no gate could see
 * the difference.
 */
body.pha-page .t33-page-main .entry-content {
	display: flow-root;
}

/*
 * The prose measure. Enumerated by tag rather than written as
 * `> *:not(.pha)`, which is what the word search shipped first: a
 * :not() selector also narrows MEDIAVINE'S INJECTED CONTAINERS to 760px,
 * quietly shrinking every in-content unit on the page. Ad units, the tool and
 * the tool strip are divs and navs, so enumerating prose tags leaves them at
 * full column width.
 *
 * `:is()` takes the specificity of its heaviest argument -- a type selector,
 * (0,0,1) -- so this lands at (0,3,2) and beats ruki-child's (0,3,1).
 */
body.pha-page .t33-page-main .entry-content > :is(p, h2, h3, h4, h5, h6, ul, ol, dl, blockquote, figure, pre) {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}

/*
 * Room for the card to land in. The theme ships `padding: 170px 0 90px`; the
 * extra bottom padding here is spent by the lift below, so the title keeps the
 * breathing room it has today and the tool does not move down the page.
 */
body.pha-page .t33-page-hero {
	padding-bottom: 132px;
}

/*
 * The lift. Mirrors `.t33-article-media`, which is what the theme already does
 * with a featured image on every other page of the site.
 *
 * The hero is a sibling of `.wrap`, not an ancestor, so its `overflow: hidden`
 * cannot clip this; and it carries no `z-index`, so `z-index: 5` here paints
 * over it. Both of those are the theme's own assumptions -- `.t33-article-media`
 * relies on exactly the same two facts.
 *
 * The ring in the first shadow is load-bearing, not decoration. The word
 * search board's background is #070b1a, byte-identical to the band's bottom
 * gradient stop (--t33-navy-1), so without a hairline the lifted panel would
 * dissolve into the band instead of sitting on it.
 *
 * `border-radius` is deliberately NOT set: each tool keeps its own (18px for
 * the board, 10px for the drill card), and the word search flattens it to 0
 * when the board goes full-bleed on a phone.
 *
 * `:first-child` is a safety catch, not tidiness. If Journey ever inserts a
 * unit at the very top of `.entry-content`, the tool stops being the first
 * child and the lift drops -- which is the right failure. Without it the tool
 * would keep its -72px and ride up over the ad unit.
 */
body.pha-page .t33-page-main .entry-content > .pha:first-child {
	position: relative;
	z-index: 5;
	margin-top: -72px;
	box-shadow:
		0 0 0 1px rgba(232, 238, 252, 0.18),
		0 26px 60px rgba(7, 11, 26, 0.45);
}

/*
 * The first paragraph after the tool carries the page. It is still a top-level
 * child of `.entry-content` -- only its type scale changed.
 */
body.pha-page .t33-page-main .entry-content > .pha + p {
	font-size: 1.18rem;
	line-height: 1.7;
	color: var(--t33-ink-soft, #5a6378);
}

/*
 * Section headings get an accent marker instead of being a bare bold line.
 * `::before` is used rather than a wrapper element precisely because a wrapper
 * would swallow an ad slot.
 */
body.pha-page .t33-page-main .entry-content > h2 {
	position: relative;
	padding-top: 22px;
	margin-top: 2.4em;
}

body.pha-page .t33-page-main .entry-content > h2::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 54px;
	height: 4px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--t33-cyan, #2bc8e8), var(--t33-coral, #f67280));
}

/*
 * FAQ pairs, styled through an adjacent-sibling selector. A `<details>` or a
 * wrapper would read better in isolation and cost an ad slot per question.
 */
body.pha-page .t33-page-main .entry-content > h3 {
	margin-top: 1.8em;
	font-size: 1.22rem;
}

body.pha-page .t33-page-main .entry-content > h3 + p {
	border-left: 3px solid rgba(43, 200, 232, 0.35);
	padding-left: 16px;
	color: var(--t33-ink-soft, #5a6378);
}

/*
 * Opt-in callout, applied to a top-level <p> in the content/*.html articles.
 * content-check.js balances tags and never inspects attributes, so adding a
 * class to those files is safe.
 */
body.pha-page .t33-page-main .entry-content > p.t33-callout {
	background: var(--t33-paper-soft, #fff7f3);
	border-left: 4px solid var(--t33-coral, #f67280);
	border-radius: 0 var(--t33-radius, 14px) var(--t33-radius, 14px) 0;
	padding: 18px 22px;
	font-size: 1.02rem;
}

body.pha-page .t33-page-main .entry-content > ul > li::marker,
body.pha-page .t33-page-main .entry-content > ol > li::marker {
	color: var(--t33-cyan, #2bc8e8);
}

/* -------------------------------------------------- more science tools --- */

/*
 * Appended by a `the_content` filter, so it is a top-level child of
 * `.entry-content` like any other -- it ADDS an ad boundary rather than
 * removing one, and it reaches pages that do not exist yet.
 */
body.pha-page .t33-page-main .entry-content > .t33-toolstrip {
	margin-top: 3em;
	padding-top: 1.6em;
	border-top: 1px solid #e3e7ef;
}

body.pha-page .entry-content .t33-toolstrip-title {
	margin: 0 0 1em;
	font-size: 0.82rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--t33-ink-soft, #5a6378);
}

body.pha-page .entry-content .t33-toolstrip-list {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}

body.pha-page .entry-content .t33-toolstrip-list li {
	margin: 0;
}

body.pha-page .entry-content .t33-toolstrip-card {
	display: block;
	height: 100%;
	padding: 16px 18px;
	background: var(--t33-paper, #fff);
	border: 1px solid #e3e7ef;
	border-radius: var(--t33-radius, 14px);
	box-shadow: var(--t33-shadow, 0 10px 30px rgba(7, 11, 26, 0.10));
	color: var(--t33-ink, #1b2233);
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.pha-page .entry-content .t33-toolstrip-card:hover {
	color: var(--t33-ink, #1b2233);
	transform: translateY(-2px);
	box-shadow: var(--t33-shadow-lift, 0 18px 44px rgba(7, 11, 26, 0.16));
}

body.pha-page .entry-content .t33-toolstrip-name {
	display: block;
	font-weight: 800;
	font-size: 1.02rem;
	margin-bottom: 4px;
}

body.pha-page .entry-content .t33-toolstrip-what {
	display: block;
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--t33-ink-soft, #5a6378);
}

/* ------------------------------------------------------------- phone ---- */

/* 600px is the theme's own hero breakpoint, not a new one. */
@media (max-width: 600px) {

	/*
	 * The phone gutter, reclaimed. The theme gutters this column twice -- the
	 * parent theme's bare `.entry-content { padding: 0 30px }` plus
	 * `.t33-page-main`'s own 18px -- so on a 390px phone the tool had 314px to
	 * work with and lost 76px, a fifth of the screen, to empty margin. Measured,
	 * not guessed.
	 *
	 * 12px rather than 0: the prose inside this column still needs an edge, and
	 * every tool card carries its own padding on top of this. Ad containers are
	 * children of `.entry-content` too, so they get the width back as well.
	 */
	body.pha-page .t33-page-main {
		padding-left: 8px;
		padding-right: 8px;
	}

	body.pha-page .t33-page-main .entry-content {
		padding-left: 12px;
		padding-right: 12px;
	}

	body.pha-page .t33-page-hero {
		padding-bottom: 88px;
	}

	body.pha-page .t33-page-main .entry-content > .pha:first-child {
		margin-top: -44px;
	}

	body.pha-page .t33-page-main .entry-content > .pha + p {
		font-size: 1.1rem;
	}
}

@media (prefers-reduced-motion: reduce) {

	body.pha-page .entry-content .t33-toolstrip-card {
		transition: none;
	}

	body.pha-page .entry-content .t33-toolstrip-card:hover {
		transform: none;
	}
}

/* <<< t33 tool-page shell */
