/* Focus Pediatrics Dosage Chart — scoped under .fpdc-wrap */

.fpdc-wrap {
	--fp-navy: #14213d;
	--fp-blue: #1d8fc7;
	--fp-blue-pale: #e8f4fa;
	--fp-red: #d64545;
	--fp-amber: #f5b800;
	--fp-gray-900: #1a202c;
	--fp-gray-700: #4a5568;
	--fp-gray-500: #718096;
	--fp-gray-300: #cbd5e0;
	--fp-gray-200: #e2e8f0;
	--fp-gray-100: #f7fafc;
	max-width: 880px;
	margin: 0 auto;
	color: var(--fp-gray-900);
	line-height: 1.55;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.fpdc-wrap *, .fpdc-wrap *::before, .fpdc-wrap *::after { box-sizing: border-box; }
.fpdc-wrap h1, .fpdc-wrap h2, .fpdc-wrap h3, .fpdc-wrap p, .fpdc-wrap ul { margin: 0; padding: 0; }

.fpdc-card, .fpdc-call-us, .fpdc-ref-section {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(20, 33, 61, 0.06);
	overflow: hidden;
	margin-bottom: 20px;
}

/* Header */
.fpdc-header {
	background: linear-gradient(135deg, var(--fp-navy) 0%, #1d3a6e 100%);
	color: #fff;
	padding: clamp(20px, 5vw, 32px) clamp(20px, 5vw, 32px) clamp(18px, 4vw, 28px);
}
.fpdc-eyebrow {
	display: inline-block;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.25);
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 11px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	font-weight: 600;
	margin-bottom: 12px;
}
.fpdc-header h1 {
	font-size: clamp(21px, 5vw, 28px);
	letter-spacing: -0.5px;
	margin-bottom: 6px;
	color: #fff;
	line-height: 1.25;
}
.fpdc-header p { opacity: 0.85; font-size: 15px; }

/* "Read more" disclosure for the second intro paragraph */
.fpdc-intro-more { margin-top: 8px; }
.fpdc-intro-more summary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	list-style: none;
	font-size: 14px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.95);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.fpdc-intro-more summary::-webkit-details-marker { display: none; }
.fpdc-intro-more summary::after {
	content: "▾";
	font-size: 11px;
	text-decoration: none;
	transition: transform 0.15s;
}
.fpdc-intro-more[open] summary::after { transform: rotate(180deg); }
.fpdc-intro-more .fpdc-less-label { display: none; }
.fpdc-intro-more[open] .fpdc-more-label { display: none; }
.fpdc-intro-more[open] .fpdc-less-label { display: inline; }
.fpdc-intro-more p { margin-top: 8px; }

/* Med tabs */
.fpdc-med-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	background: var(--fp-gray-100);
	border-bottom: 1px solid var(--fp-gray-200);
}
.fpdc-med-tab {
	padding: 18px 12px;
	min-height: 60px;
	text-align: center;
	cursor: pointer;
	font-weight: 600;
	font-size: 15px;
	color: var(--fp-gray-500);
	background: var(--fp-gray-100);
	border: none;
	border-bottom: 3px solid transparent;
	transition: all 0.15s;
	font-family: inherit;
}
.fpdc-med-tab.active {
	background: #fff;
	color: var(--fp-navy);
	border-bottom-color: var(--fp-blue);
}
.fpdc-med-tab .fpdc-small {
	display: block;
	font-weight: 400;
	font-size: 12px;
	color: var(--fp-gray-500);
	margin-top: 2px;
}
.fpdc-med-tab.active .fpdc-small { color: var(--fp-blue); }

/* Inputs */
.fpdc-inputs {
	padding: 28px 32px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}
.fpdc-full { grid-column: 1 / -1; }
@media (max-width: 640px) {
	.fpdc-inputs { grid-template-columns: 1fr; padding: 24px 20px; }
}
.fpdc-input-group label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--fp-gray-700);
	margin-bottom: 8px;
}
.fpdc-row { display: flex; gap: 8px; }
/* Explicit heights (with !important) so theme form styles can't squash the
   inputs out of alignment with the unit toggles. */
.fpdc-num {
	flex: 1;
	width: 100%;
	min-width: 0;
	height: 52px !important;
	padding: 0 14px !important;
	border: 2px solid var(--fp-gray-300);
	border-radius: 8px;
	font-size: 18px !important;
	line-height: normal !important;
	font-weight: 600;
	color: var(--fp-navy);
	font-family: inherit;
	transition: border-color 0.15s;
}
.fpdc-num:focus { outline: none; border-color: var(--fp-blue); }
.fpdc-toggle {
	display: flex;
	background: var(--fp-gray-100);
	border: 1px solid var(--fp-gray-200);
	border-radius: 8px;
	padding: 4px;
	flex-shrink: 0;
	height: 52px;
}
.fpdc-toggle button {
	background: transparent;
	border: none;
	padding: 0 16px;
	min-height: 42px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	color: var(--fp-gray-500);
	font-family: inherit;
	transition: all 0.15s;
}
.fpdc-toggle button.active {
	background: var(--fp-blue);
	color: #fff;
	box-shadow: 0 2px 6px rgba(29, 143, 199, 0.35);
}
.fpdc-select {
	width: 100%;
	height: 52px !important;
	padding: 0 36px 0 14px !important;
	border: 2px solid var(--fp-gray-300);
	border-radius: 8px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231d8fc7' d='M6 8L0 0h12z'/%3E%3C/svg%3E") no-repeat right 14px center;
	font-size: 14px;
	color: var(--fp-navy);
	font-family: inherit;
	font-weight: 500;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}
.fpdc-select:focus { outline: none; border-color: var(--fp-blue); }

/* Result */
.fpdc-result {
	margin: 0 32px 28px;
	padding: 24px;
	background: linear-gradient(135deg, var(--fp-blue-pale) 0%, #fff 100%);
	border: 2px solid var(--fp-blue);
	border-radius: 12px;
}
@media (max-width: 640px) {
	.fpdc-result { margin: 0 20px 24px; padding: 20px; }
}
.fpdc-result.warn {
	background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
	border-color: var(--fp-red);
}
.fpdc-result-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--fp-blue);
	margin-bottom: 8px;
}
.fpdc-result.warn .fpdc-result-label { color: var(--fp-red); }
.fpdc-dose-row {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 24px;
	align-items: center;
}
@media (max-width: 480px) {
	.fpdc-dose-row { grid-template-columns: 1fr; gap: 12px; }
}
.fpdc-dose-amount {
	font-size: clamp(36px, 10vw, 48px);
	font-weight: 800;
	color: var(--fp-navy);
	line-height: 1;
	letter-spacing: -1px;
}
.fpdc-dose-amount small {
	font-size: 16px;
	font-weight: 500;
	color: var(--fp-gray-500);
	margin-left: 4px;
}
.fpdc-dose-detail { font-size: 14px; color: var(--fp-gray-700); }
.fpdc-mg-line { font-weight: 600; color: var(--fp-navy); margin-bottom: 4px; font-size: 15px; }
.fpdc-freq-line { margin-bottom: 4px; }
.fpdc-max-line { color: var(--fp-gray-500); font-size: 13px; }
.fpdc-warn-msg { font-size: 15px; color: var(--fp-red); font-weight: 600; margin-bottom: 6px; }
.fpdc-warn-detail { font-size: 14px; color: var(--fp-gray-700); }
.fpdc-danger-text { color: var(--fp-red); }

/* Safety */
.fpdc-safety {
	padding: 24px 32px;
	border-top: 1px solid var(--fp-gray-200);
	background: var(--fp-gray-100);
}
@media (max-width: 640px) { .fpdc-safety { padding: 20px; } }
/* Section headings are h2 for document outline (h1 → h2 siblings), but keep
   the signed-off h3-era look: pin every property a theme could style
   differently per heading level. */
.fpdc-safety h2 {
	font-size: 13px;
	font-weight: 700;
	font-family: inherit;
	line-height: 1.55;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--fp-gray-700);
	margin-bottom: 12px;
}
.fpdc-safety ul { list-style: none; }
.fpdc-safety li {
	padding-left: 26px;
	position: relative;
	font-size: 14px;
	color: var(--fp-gray-700);
	margin-bottom: 8px;
	line-height: 1.5;
}
.fpdc-safety li::before {
	content: "⚠";
	position: absolute;
	left: 0;
	top: 0;
	color: var(--fp-amber);
	font-size: 14px;
}
.fpdc-safety li.danger::before { content: "✕"; color: var(--fp-red); font-weight: 700; }
.fpdc-safety li.info::before { content: "ⓘ"; color: var(--fp-blue); }

/* Call us */
.fpdc-call-us {
	padding: 24px 32px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}
@media (max-width: 640px) { .fpdc-call-us { padding: 20px; } }
.fpdc-call-text h2 {
	font-size: 18px;
	font-weight: 700;
	font-family: inherit;
	line-height: 1.55;
	letter-spacing: normal;
	text-transform: none;
	color: var(--fp-navy);
	margin-bottom: 4px;
}
.fpdc-call-text p { font-size: 14px; color: var(--fp-gray-700); }
.fpdc-phone {
	background: var(--fp-blue);
	color: #fff !important;
	padding: 14px 22px;
	border-radius: 10px;
	font-size: 18px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}
.fpdc-phone:hover { background: var(--fp-navy); }

/* Reference table */
.fpdc-ref-header {
	padding: 24px 32px 16px;
	border-bottom: 1px solid var(--fp-gray-200);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}
@media (max-width: 640px) { .fpdc-ref-header { padding: 20px 20px 14px; } }
.fpdc-ref-header h2 {
	font-size: 20px;
	font-weight: 700;
	font-family: inherit;
	line-height: 1.55;
	letter-spacing: normal;
	text-transform: none;
	color: var(--fp-navy);
}
/* The medication switcher next to the reference table is a primary control,
   not a unit toggle — render it noticeably larger than the base .fpdc-toggle. */
.fpdc-ref-header .fpdc-toggle {
	height: 60px;
	padding: 5px;
}
.fpdc-ref-header .fpdc-toggle button {
	min-height: 48px;
	padding: 0 24px;
	font-size: 16px;
}
@media (max-width: 640px) {
	.fpdc-ref-header .fpdc-toggle { width: 100%; }
	.fpdc-ref-header .fpdc-toggle button { flex: 1; }
}
.fpdc-ref-sub { font-size: 13px; color: var(--fp-gray-500); margin-top: 2px; }
.fpdc-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.fpdc-ref {
	width: 100%;
	min-width: 560px;
	border-collapse: collapse;
	font-size: 14px;
}
.fpdc-ref th, .fpdc-ref td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--fp-gray-100);
}
.fpdc-ref th {
	background: var(--fp-gray-100);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--fp-gray-700);
	font-weight: 700;
	white-space: nowrap;
}
.fpdc-ref td { color: var(--fp-gray-900); font-variant-numeric: tabular-nums; }
.fpdc-ref td.fpdc-weight-cell { font-weight: 600; color: var(--fp-navy); }
.fpdc-ref tr:hover td { background: var(--fp-blue-pale); }
.fpdc-ref .fpdc-danger-row td { color: var(--fp-red); font-style: italic; }

/* Closing note below the calculator */
.fpdc-closing {
	margin: 0 0 20px;
	padding: 0 8px;
	font-size: 15px;
	color: var(--fp-gray-700);
	line-height: 1.6;
}
.fpdc-closing a {
	color: var(--fp-blue);
	font-weight: 600;
	text-decoration: none;
}
.fpdc-closing a:hover { text-decoration: underline; }

/* Actions + legal */
.fpdc-actions { text-align: center; margin-bottom: 16px; }
.fpdc-btn {
	background: #fff;
	color: var(--fp-navy);
	border: 1px solid var(--fp-gray-300);
	padding: 11px 18px;
	min-height: 44px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.15s;
}
.fpdc-btn:hover { border-color: var(--fp-blue); color: var(--fp-blue); }
.fpdc-legal {
	font-size: 12px;
	color: var(--fp-gray-500);
	text-align: center;
	line-height: 1.6;
	padding: 0 8px 8px;
}
.fpdc-legal strong { color: var(--fp-gray-700); }

/* Consent gate */
.fpdc-consent-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 33, 61, 0.75);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.fpdc-consent-box {
	background: #fff;
	border-radius: 16px;
	max-width: 480px;
	width: 100%;
	padding: 28px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.fpdc-consent-box h3 {
	font-size: 20px;
	color: var(--fp-navy);
	margin-bottom: 12px;
}
.fpdc-consent-box p {
	font-size: 14px;
	color: var(--fp-gray-700);
	margin-bottom: 20px;
	max-height: 40vh;
	overflow-y: auto;
}
.fpdc-consent-agree {
	width: 100%;
	background: var(--fp-blue);
	color: #fff;
	border: none;
	padding: 14px 20px;
	min-height: 48px;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
}
.fpdc-consent-agree:hover { background: var(--fp-navy); }

/* Print: show only the chart (theme header/nav/footer hidden), and swap the
   dark header for ink-friendly navy-on-white since browsers strip background
   colors by default. */
@media print {
	body * { visibility: hidden; }
	.fpdc-wrap, .fpdc-wrap * { visibility: visible; }
	.fpdc-wrap {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		max-width: none;
		margin: 0;
	}
	.fpdc-actions, .fpdc-consent-overlay { display: none !important; }
	.fpdc-card, .fpdc-ref-section, .fpdc-call-us {
		box-shadow: none;
		border: 1px solid var(--fp-gray-300);
		border-radius: 8px;
		page-break-inside: avoid;
	}
	.fpdc-header {
		background: none !important;
		border-bottom: 2px solid var(--fp-navy);
	}
	.fpdc-header h1 { color: var(--fp-navy); }
	.fpdc-header p { opacity: 1; color: var(--fp-gray-700); }
	.fpdc-intro-more summary { display: none; }
	.fpdc-eyebrow {
		background: none;
		border-color: var(--fp-navy);
		color: var(--fp-navy);
	}
	.fpdc-phone {
		background: none !important;
		color: var(--fp-navy) !important;
		border: 1px solid var(--fp-gray-300);
	}
	/* Some themes hide all <button>s in print — keep the med-tab labels
	   visible for context, and drop the unit toggles (meaningless on paper). */
	.fpdc-med-tab { display: block !important; background: none; }
	.fpdc-med-tabs { background: none; }
	.fpdc-toggle { display: none !important; }
	.fpdc-table-scroll { overflow: visible; }
	.fpdc-ref { min-width: 0; }
	.fpdc-ref tr:hover td { background: none; }
}
