/* Pilot tools (calculators) on /tools/: the form, the results and the tool cards.
   Self-contained: style.min.css has no Bootstrap form classes (PurgeCSS removed them). */

.wm-tool {
	max-width: 750px;
	margin: 0 auto 2.5rem;
	background: #f8f9fa;
	border: 1px solid #e6e8eb;
	border-radius: 10px;
	padding: 1.5rem;
}

.wm-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem 1.25rem;
}

.wm-field {
	min-width: 0;
}

.wm-field.wm-wide {
	grid-column: 1 / -1;
}

.wm-field label {
	display: block;
	font-weight: 600;
	font-size: 0.95rem;
	margin-bottom: 0.35rem;
	color: #222;
}

.wm-field .wm-optional {
	font-weight: 400;
	color: #777;
}

.wm-input {
	display: flex;
	align-items: stretch;
}

.wm-tool input[type="text"],
.wm-tool select {
	font: inherit;
	font-size: 1.05rem;
	color: #222;
	background: #fff;
	border: 1px solid #c9ced4;
	border-radius: 8px;
	height: 2.75rem;
	padding: 0 0.75rem;
	min-width: 0;
	box-sizing: border-box;
}

.wm-tool input[type="text"] {
	flex: 1 1 auto;
	width: 100%;
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

/* ± next to a temperature or an elevation: the iPhone's decimal keypad has no minus key */
.wm-input .wm-sign {
	flex: 0 0 auto;
	width: 2.75rem;
	font: inherit;
	font-size: 1.15rem;
	line-height: 1;
	color: #222;
	background: #eef1f4;
	border: 1px solid #c9ced4;
	border-left: 0;
	padding: 0;
	cursor: pointer;
}

.wm-input select {
	flex: 0 0 auto;
	width: auto;
	border-left: 0;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
	background-color: #eef1f4;
	padding-right: 0.5rem;
	cursor: pointer;
}

.wm-input .wm-unit {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	padding: 0 0.75rem;
	font-size: 1.05rem;
	color: #444;
	background: #eef1f4;
	border: 1px solid #c9ced4;
	border-left: 0;
	border-radius: 0 8px 8px 0;
	white-space: nowrap;
}

.wm-tool select.wm-select {
	width: 100%;
	cursor: pointer;
}

/* Not the IGC viewer's hidden file input: its button shows the focus */
.wm-tool input[type="text"]:focus,
.wm-tool select:focus,
.wm-input .wm-sign:focus-visible {
	outline: 2px solid rgba(var(--cnvs-themecolor-rgb, 0, 122, 255), 0.5);
	outline-offset: 1px;
	position: relative;
	z-index: 1;
}

.wm-help {
	font-size: 0.85rem;
	line-height: 1.45;
	color: #666;
	margin: 0.35rem 0 0;
}

.wm-message {
	margin: 1rem 0 0;
	padding: 0.6rem 0.9rem;
	border-radius: 8px;
	background: #fff4e5;
	color: #8a4b00;
	font-size: 0.95rem;
}

.wm-results {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid #e0e3e7;
}

.wm-results.wm-stale {
	opacity: 0.35;
}

.wm-main {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0.75rem;
	margin-bottom: 0.75rem;
}

.wm-main output {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--cnvs-themecolor, #007AFF);
}

.wm-main .wm-main-label {
	font-size: 1rem;
	color: #444;
}

.wm-rows {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* The first selector outranks blog.css's .single-post .entry-content li */
.single-post .entry-content .wm-rows li,
.wm-rows li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin: 0;
	padding: 0.45rem 0;
	border-bottom: 1px solid #e9ecef;
	font-size: 0.98rem;
	line-height: 1.4;
}

.wm-rows li:last-child {
	border-bottom: 0;
}

.wm-rows li span {
	color: #555;
}

.wm-rows li output {
	font-weight: 600;
	color: #222;
	text-align: right;
}

.wm-rows-after {
	margin-top: 0.75rem;
}

.wm-subtitle {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 1.5rem 0 0.75rem;
	padding-top: 1.25rem;
	border-top: 1px solid #e0e3e7;
}

.wm-verdict {
	margin-top: 1rem;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	font-weight: 600;
	line-height: 1.45;
}

.wm-verdict.wm-ok {
	background: #e8f6ec;
	color: #1d6b34;
}

.wm-verdict.wm-tight {
	background: #fff4e5;
	color: #8a4b00;
}

.wm-verdict.wm-no {
	background: #fdecec;
	color: #a12622;
}

.wm-private {
	font-size: 0.85rem;
	color: #777;
	margin: 1rem 0 0;
}

[hidden] {
	display: none !important;
}

/* Tool cards on /tools/ */
.wm-cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.25rem;
	max-width: 850px;
	margin: 0 auto 2.5rem;
}

.wm-card {
	display: block;
	background: #f8f9fa;
	border: 1px solid #e6e8eb;
	border-radius: 10px;
	padding: 1.25rem;
	color: #333;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.wm-card:hover,
.wm-card:focus {
	border-color: var(--cnvs-themecolor, #007AFF);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
	color: #333;
}

.wm-card h2 {
	font-size: 1.2rem;
	margin: 0 0 0.5rem;
	color: var(--cnvs-themecolor, #007AFF);
}

.wm-card p {
	font-size: 0.97rem;
	line-height: 1.55;
	margin: 0;
}

/* IGC file viewer on /tools/igc-viewer/ */
.wm-tool.wm-igc {
	max-width: 1000px;
}

.wm-igc-drop {
	border: 2px dashed #c9ced4;
	border-radius: 10px;
	background: #fff;
	padding: 2rem 1rem 1.25rem;
	text-align: center;
	transition: border-color 0.2s, background-color 0.2s;
}

.wm-igc-drop.wm-igc-over {
	border-color: var(--cnvs-themecolor, #007AFF);
	background: rgba(var(--cnvs-themecolor-rgb, 0, 122, 255), 0.06);
}

.wm-igc-drop-title {
	font-size: 1.15rem;
	font-weight: 600;
	color: #222;
	margin: 0 0 1rem;
}

.wm-igc-drop .wm-help {
	margin-top: 1rem;
}

/* Scrolled into view when a file can't be read: clear of the sticky header */
.wm-igc .wm-message {
	scroll-margin-top: 80px;
}

.wm-igc-file {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wm-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	background: var(--cnvs-themecolor, #007AFF);
	border: 0;
	border-radius: 8px;
	padding: 0.7rem 1.2rem;
	margin: 0;
	cursor: pointer;
}

.wm-button:hover {
	color: #fff;
	filter: brightness(1.08);
}

.wm-button.wm-button-light,
.wm-button.wm-button-light:hover {
	color: #222;
	background: #e6e9ed;
}

.wm-igc-file:focus-visible + .wm-button,
.wm-button:focus-visible,
.wm-link:focus-visible {
	outline: 2px solid rgba(var(--cnvs-themecolor-rgb, 0, 122, 255), 0.5);
	outline-offset: 2px;
}

.wm-link {
	font: inherit;
	color: var(--cnvs-themecolor, #007AFF);
	background: none;
	border: 0;
	padding: 0;
	text-decoration: underline;
	cursor: pointer;
}

.wm-igc-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.wm-igc-name {
	margin: 0;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.wm-igc-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

/* 16px at least, or iPhone Safari zooms in on the menu and stays zoomed */
.wm-tool .wm-igc-controls select.wm-select {
	width: auto;
	height: 2.4rem;
	font-size: 1rem;
}

.wm-igc-map {
	height: 440px;
	border-radius: 8px;
	overflow: hidden;
	background: #dfe3e8;
}

.wm-igc-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
	box-sizing: border-box;
}

.wm-igc-start {
	background: #34C759;
}

.wm-igc-end {
	background: #FF3B30;
}

.wm-igc-dot.wm-igc-here {
	width: 18px;
	height: 18px;
	background: #fff;
	border: 4px solid #222;
}

.wm-igc-chart {
	height: 200px;
	margin-top: 1.25rem;
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
	cursor: crosshair;
}

.wm-igc-chart svg {
	display: block;
}

.wm-igc-grid line {
	stroke: #e1e4e8;
}

.wm-igc-grid text {
	font-size: 11px;
	fill: #777;
}

.wm-igc-area {
	fill: rgba(var(--cnvs-themecolor-rgb, 0, 122, 255), 0.12);
}

.wm-igc-line {
	fill: none;
	stroke: var(--cnvs-themecolor, #007AFF);
	stroke-width: 2;
	stroke-linejoin: round;
}

.wm-igc-cursor line {
	stroke: #222;
	stroke-width: 1;
}

.wm-igc-cursor circle {
	fill: #fff;
	stroke: #222;
	stroke-width: 2;
}

.wm-igc-hint {
	text-align: center;
}

.wm-igc-readout {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.25rem 1.25rem;
	margin: 0.35rem 0 0;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.wm-igc-tiles {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 1.5rem 0 0.75rem;
	padding: 0;
	list-style: none;
}

.wm-igc-tiles li {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	margin: 0;
	padding: 0.7rem 0.85rem;
	background: #fff;
	border: 1px solid #e6e8eb;
	border-radius: 8px;
}

.wm-igc-tiles span {
	font-size: 0.85rem;
	color: #555;
}

.wm-igc-tiles output {
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--cnvs-themecolor, #007AFF);
}

.wm-igc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 1.25rem;
}

@media (max-width: 767.98px) {
	.wm-tool {
		padding: 1.1rem;
		border-radius: 8px;
	}
	.wm-fields {
		grid-template-columns: minmax(0, 1fr);
	}
	.wm-cards {
		grid-template-columns: minmax(0, 1fr);
	}
	.wm-main output {
		font-size: 1.7rem;
	}
	.wm-igc-map {
		height: 320px;
	}
	.wm-igc-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
