/*
 * The existing page is deliberately editorial: warm paper, dark ink, and
 * restrained blue. These rules reuse its variables instead of importing a
 * component library or introducing a generic dashboard treatment.
 */
.binomlab-seo-enhancement {
	background: var(--paper-alt, #f3f1ec);
	border-block: 1px solid var(--border, rgb(15 14 12 / 10%));
	color: var(--ink, #0f0e0c);
	padding: clamp(3.5rem, 7vw, 5.5rem) 0;
}

.binomlab-seo-enhancement .section-eyebrow {
	color: var(--gold, #c8922a);
	margin-bottom: 0.65rem;
}

.binomlab-seo-enhancement h2 {
	font-size: clamp(1.9rem, 4vw, 2.7rem);
	margin: 0 0 0.9rem;
	max-width: 18ch;
}

.binomlab-seo-enhancement p {
	color: var(--ink-muted, #5a5852);
}

.binomlab-seo-intro {
	max-width: 62ch;
}

.calc-section .binomlab-search-clarifier {
	border-left: 2px solid var(--gold, #c8922a);
	margin: -1rem auto 2rem;
	max-width: 68ch;
	padding-left: 1rem;
}

.binomlab-seo-grid {
	display: grid;
	border-top: 1px solid var(--border-md, rgb(15 14 12 / 16%));
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-top: 2.25rem;
}

.binomlab-seo-card {
	background: transparent;
	border-bottom: 1px solid var(--border, rgb(15 14 12 / 10%));
	min-height: 9.5rem;
	padding: 1.5rem clamp(1rem, 3vw, 2rem);
}

.binomlab-seo-card:nth-child(odd) {
	border-right: 1px solid var(--border, rgb(15 14 12 / 10%));
}

.binomlab-seo-card h3,
.binomlab-seo-source h3 {
	font-size: 1.15rem;
	margin: 0 0 0.45rem;
}

.binomlab-seo-card p,
.binomlab-seo-source p {
	margin: 0;
}

.binomlab-seo-card strong {
	color: var(--ink, #0f0e0c);
}

.binomlab-seo-methodology {
	background: var(--paper, #faf9f6);
}

.binomlab-seo-methodology-layout {
	display: grid;
	gap: clamp(2rem, 6vw, 5rem);
	grid-template-columns: minmax(0, 1.55fr) minmax(17rem, 0.8fr);
	align-items: start;
}

.binomlab-seo-methodology-layout > div > p + p,
.binomlab-seo-source p + p {
	margin-top: 1rem;
}

.binomlab-seo-source {
	border-left: 2px solid var(--gold, #c8922a);
	padding-left: 1.25rem;
}

.binomlab-seo-enhancement a {
	color: var(--accent-mid, #2a57a0);
	text-decoration: underline;
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.16em;
}

/* A quieter refinement of the existing UI: hierarchy and inputs stay primary. */
.hero .hero-badge {
	background: transparent;
	border-radius: 0;
}

.hero .badge-dot {
	animation: none;
}

.hero .hero-card-float,
.calc-panel {
	box-shadow: none;
}

.hero .hero-card-float {
	background: rgb(255 255 255 / 4%);
	border-radius: var(--radius, 6px);
}

.eeat-grid,
.features-grid,
.steps-grid,
.examples-grid {
	border-radius: var(--radius, 6px);
	gap: 0;
}

.eeat-card:hover,
.feature-card:hover {
	background: var(--paper-card, #fff);
}

/*
 * The calculator has four distinct jobs: set inputs, read the answer, inspect
 * the distribution, and interpret its summary. On wider screens these belong
 * side by side; on small screens the original single-column order remains.
 */
@media (min-width: 861px) {
	.calc-section .calc-layout {
		display: grid;
		align-items: start;
		gap: clamp(1.25rem, 3vw, 2.5rem);
		grid-template-columns: minmax(19rem, 0.85fr) minmax(0, 1.15fr);
	}

	.calc-section .calc-panel {
		margin-bottom: 0;
	}

	.calc-section .chart-panel {
		display: grid;
		align-items: stretch;
		border: 1px solid var(--border-md, rgb(15 14 12 / 16%));
		grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.72fr);
		overflow: hidden;
	}

	.calc-section .chart-panel-left {
		border-right: 1px solid var(--border, rgb(15 14 12 / 10%));
	}
}

.calc-section .inputs-panel,
.calc-section .results-panel,
.calc-section .chart-panel-left,
.calc-section .chart-panel-right {
	border-radius: var(--radius, 6px);
}

.calc-section .chart-panel {
	margin-top: clamp(1.25rem, 3vw, 2.5rem);
}

.calc-section .chart-panel-left,
.calc-section .chart-panel-right {
	padding: clamp(1.25rem, 3vw, 1.75rem);
}

.calc-section .chart-panel-right {
	background: var(--paper-alt, #f3f1ec);
}

.calc-section .chart-stats-grid {
	gap: 0;
}

.calc-section .cstat {
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--border, rgb(15 14 12 / 10%));
	border-radius: 0;
	padding: 0.85rem 0;
}

.calc-section .cstat:nth-last-child(-n + 2) {
	border-bottom: 0;
}

.calc-section .chart-legend {
	border-top: 1px solid var(--border, rgb(15 14 12 / 10%));
	margin-top: 1rem;
	padding-top: 0.85rem;
}

.binomlab-field-error {
	color: #9d1f1f;
	font-size: 0.82rem;
	font-weight: 600;
	margin: 0.5rem 0 0;
}

.calc-section input[aria-invalid="true"] {
	border-color: #9d1f1f;
	box-shadow: 0 0 0 1px #9d1f1f;
}

.calc-section #dist-chart,
.calc-section #distribucionChart,
.calc-section .binomlab-chart-canvas {
	max-height: 360px;
}

:where(a, button, input, select, summary):focus-visible {
	outline: 3px solid var(--gold, #c8922a);
	outline-offset: 3px;
}

@media (max-width: 900px) {
	.binomlab-seo-methodology-layout {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 860px) {
	.calc-section .chart-panel {
		border: 1px solid var(--border-md, rgb(15 14 12 / 16%));
		overflow: hidden;
	}

	.calc-section .chart-panel-left {
		border-bottom: 1px solid var(--border, rgb(15 14 12 / 10%));
	}
}

@media (max-width: 560px) {
	.binomlab-seo-grid {
		grid-template-columns: 1fr;
	}

	.binomlab-seo-card:nth-child(odd) {
		border-right: 0;
	}

	.binomlab-seo-card {
		min-height: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}
/* Audit 2.0: make the tool easier to reach and retain the existing editorial identity. */
#hero { min-height: 0; padding-block: 1.5rem; }
#hero .hero-layout { min-height: 0; }
#hero .hero-content { padding-top: 1rem; padding-bottom: 1rem; }
#hero .hero-title { font-size: clamp(2.2rem, 4vw, 3.25rem); }
#hero .hero-actions { margin-bottom: 1.5rem; }
#calculator { padding-top: 2.5rem; }
#calculator .calc-header { margin-bottom: 1.5rem; }
#calculator .calc-header h2 { margin-bottom: 1rem; }
#calculator, #binompdf-vs-binomcdf, #ti84-guide, #worked-examples, #binomial-formula { scroll-margin-top: 6rem; }
.radio-option { position: relative; }
.radio-option input[type="radio"] {
  display: block !important; position: absolute; width: 1px; height: 1px; opacity: 0;
}
.radio-option:focus-within { outline: 3px solid var(--gold, #c8922a); outline-offset: 2px; }
.binomlab-chart-note { font-size: 0.85rem; line-height: 1.6; margin-top: 1rem; }
.calc-section .chart-panel-left, .calc-section .chart-panel-right { min-width: 0; }
.calc-section .chart-panel { grid-template-columns: minmax(0, 1.45fr) minmax(14rem, 0.8fr); }
.calc-section table caption { text-align: left; font-size: 0.85rem; margin-bottom: 0.5rem; }
.calc-section button:disabled { opacity: 0.55; cursor: not-allowed; }
#ti84-modal[hidden] { display: none !important; }
#ti84-modal .modal-box { max-height: 85vh; overflow-y: auto; }
#binomlab-noscript { display: block; margin: 1rem; }
@media (max-width: 860px) {
  .calc-section .chart-panel { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  #hero .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; padding-top: 1rem; }
  #hero .hstat { padding: 0; border: 0; }
  #hero .hstat-sep { display: none; }
  #hero .hero-actions .btn-ghost { padding-block: 0.5rem; border-color: transparent; }
  #calculator .calc-header h2 { font-size: 1.75rem; }
}
