/**
 * Internet Download Time Calculator.
 * Inherits fonts and colours from the theme; mobile-first.
 */

.toolodyssey-tool[data-tool="download-time"] {
	--todt-border: rgba(127, 127, 127, 0.45);
	--todt-muted: rgba(127, 127, 127, 0.12);
	--todt-error: #b3261e;
	--todt-accent: #1d4ed8;
}

.todt-form {
	display: grid;
	gap: 1rem;
	margin: 0 0 1.5rem;
}

.todt-group {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.todt-legend {
	padding: 0;
	margin: 0 0 0.5rem;
	font-weight: 600;
}

.todt-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.todt-field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	flex: 1 1 10rem;
	min-width: 0;
}

.todt-field--grow {
	flex: 2 1 10rem;
}

.todt-field label {
	font-size: 0.9375rem;
}

.todt-form input,
.todt-form select {
	width: 100%;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	font: inherit;
	font-size: max(1rem, 16px); /* 16px+ stops iOS zooming on focus. */
	color: inherit;
	background: transparent;
	border: 1px solid var(--todt-border);
	border-radius: 6px;
}

.todt-form select option {
	color: initial;
}

.todt-form input:focus-visible,
.todt-form select:focus-visible,
.todt-submit:focus-visible,
.todt-advanced summary:focus-visible {
	outline: 3px solid var(--todt-accent);
	outline-offset: 2px;
}

.todt-form input[aria-invalid="true"] {
	border-color: var(--todt-error);
	border-width: 2px;
}

.todt-error {
	margin: 0;
	color: var(--todt-error);
	font-size: 0.875rem;
}

.todt-hint {
	margin: 0;
	font-size: 0.875rem;
	opacity: 0.8;
}

.todt-advanced summary {
	cursor: pointer;
	/* At least 44px tall (20px line + 26px padding at 16px text) whatever the theme's
	   line-height; padding rather than flex keeps the native disclosure arrow. */
	padding: 0.8125rem 0;
	line-height: 1.25;
}

.todt-advanced .todt-field {
	max-width: 20rem;
	margin-top: 0.5rem;
}

.todt-submit {
	justify-self: start;
	min-height: 44px;
	padding: 0.625rem 1.25rem;
	font: inherit;
	font-weight: 600;
	color: #fff;
	background: var(--todt-accent);
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}

.todt-submit:hover {
	filter: brightness(1.1);
}

.todt-heading {
	margin: 0 0 0.75rem;
	font-size: 1.25rem;
}

.todt-results {
	margin: 0 0 2rem;
	padding: 1rem;
	background: var(--todt-muted);
	border-radius: 8px;
}

.todt-placeholder {
	margin: 0;
}

.todt-output {
	display: grid;
	gap: 1rem;
	margin: 0;
}

.todt-output__item {
	margin: 0;
}

.todt-output dt {
	font-size: 0.9375rem;
}

.todt-output dd {
	margin: 0.125rem 0 0;
	font-size: 1.125rem;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.todt-output__item--primary dd:first-of-type {
	font-size: 1.5rem;
}

.todt-output dd.todt-output__note {
	font-size: 0.875rem;
	font-weight: 400;
	opacity: 0.85;
}

.todt-info ul {
	padding-left: 1.25rem;
}

.todt-info li + li {
	margin-top: 0.5rem;
}

@media (min-width: 40rem) {
	.todt-output {
		grid-template-columns: repeat(2, 1fr);
	}

	.todt-output__item--primary {
		grid-column: 1 / -1;
	}
}
