/* Manual Ticketing Calculator — scoped styles, prefixed with .mtc- to avoid
   clashing with theme styles (including Colibri Pro). */

.mtc-app {
	--mtc-navy: #0b2340;
	--mtc-navy-light: #123a63;
	--mtc-teal: #1f6f66;
	--mtc-teal-light: #eaf6f2;
	--mtc-border: #dde4ea;
	--mtc-muted: #6b7885;
	--mtc-danger: #c15a2e;
	--mtc-danger-bg: #fdf0ea;
	--mtc-radius: 10px;
	--mtc-shadow: 0 1px 2px rgba(11, 35, 64, 0.05), 0 1px 12px rgba(11, 35, 64, 0.04);
	box-sizing: border-box;
	max-width: 1000px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1a2433;
	font-size: 13px;
	line-height: 1.42;
}

.mtc-app *,
.mtc-app *::before,
.mtc-app *::after {
	box-sizing: border-box;
}

@keyframes mtc-fade-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.mtc-shortcode-wrap .mtc-title {
	margin-bottom: 16px;
	font-weight: 700;
	color: #0b2340;
}

.mtc-print-only {
	display: none;
}

/* ---------------- Mode selector ---------------- */

.mtc-mode-select {
	animation: mtc-fade-in 0.3s ease;
}

.mtc-mode-intro {
	font-weight: 600;
	color: var(--mtc-navy);
	font-size: 15px;
	margin-bottom: 12px;
}

.mtc-mode-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 10px;
	margin-bottom: 8px;
}

.mtc-mode-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	text-align: left;
	background: #fff;
	border: 1px solid var(--mtc-border);
	border-radius: var(--mtc-radius);
	box-shadow: var(--mtc-shadow);
	padding: 12px 14px 14px;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.mtc-mode-card:hover {
	transform: translateY(-2px);
	border-color: var(--mtc-teal);
	box-shadow: 0 4px 16px rgba(11, 35, 64, 0.1);
}

.mtc-mode-card:active {
	transform: translateY(0);
}

.mtc-mode-card-disabled {
	cursor: default;
}

.mtc-mode-card-disabled:hover {
	transform: none;
	border-color: var(--mtc-border);
	box-shadow: var(--mtc-shadow);
}

.mtc-mode-card-disabled .mtc-mode-icon {
	background: #eef1f4;
	color: var(--mtc-muted);
}

.mtc-mode-card-disabled .mtc-mode-title,
.mtc-mode-card-disabled .mtc-mode-desc {
	color: var(--mtc-muted);
}

.mtc-mode-icon {
	font-size: 16px;
	color: var(--mtc-teal);
	background: var(--mtc-teal-light);
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 2px;
}

.mtc-mode-title {
	font-weight: 700;
	font-size: 13.5px;
	color: var(--mtc-navy);
}

.mtc-mode-desc {
	font-size: 11.5px;
	color: var(--mtc-muted);
	line-height: 1.45;
}

.mtc-mode-badge {
	position: absolute;
	top: 14px;
	right: 14px;
	background: var(--mtc-teal-light);
	color: var(--mtc-teal);
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	padding: 3px 8px;
	border-radius: 20px;
}

/* ---------------- Panels ---------------- */

.mtc-panel {
	display: none;
	animation: mtc-fade-in 0.3s ease;
}

.mtc-panel.mtc-open {
	display: block;
}

.mtc-back-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: none;
	color: var(--mtc-teal);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	padding: 4px 0;
	margin-bottom: 8px;
}

.mtc-back-btn:hover {
	text-decoration: underline;
}

.mtc-placeholder {
	background: #fff;
	border: 1px dashed var(--mtc-border);
	border-radius: var(--mtc-radius);
	padding: 40px 24px;
	text-align: center;
	color: var(--mtc-muted);
}

.mtc-placeholder-icon {
	font-size: 30px;
	color: var(--mtc-teal);
	margin-bottom: 8px;
}

.mtc-placeholder h3 {
	color: var(--mtc-navy);
	margin: 0 0 8px;
}

.mtc-placeholder p {
	max-width: 420px;
	margin: 0 auto;
	font-size: 13px;
	line-height: 1.6;
}

/* ---------------- Calculator ---------------- */

.mtc-calculator {
	animation: mtc-fade-in 0.35s ease;
}

.mtc-notice {
	background: var(--mtc-danger-bg);
	border-left: 4px solid var(--mtc-danger);
	padding: 7px 11px;
	border-radius: 8px;
	font-size: 12px;
	margin-bottom: 12px;
}

.mtc-notice strong {
	display: block;
	color: var(--mtc-danger);
	margin-bottom: 2px;
}

.mtc-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: flex-start;
}

.mtc-col-input {
	flex: 1 1 480px;
	min-width: 300px;
}

.mtc-col-results {
	flex: 1 1 320px;
	min-width: 280px;
	position: sticky;
	top: 10px;
}

.mtc-field-group {
	background: #fff;
	border: 1px solid var(--mtc-border);
	border-radius: var(--mtc-radius);
	box-shadow: var(--mtc-shadow);
	padding: 9px 12px 11px;
	margin: 0 0 10px;
	transition: box-shadow 0.2s ease;
}

.mtc-field-group:focus-within {
	box-shadow: 0 0 0 3px rgba(31, 111, 102, 0.12), var(--mtc-shadow);
}

.mtc-field-group legend {
	padding: 0 6px;
	font-weight: 600;
	color: var(--mtc-navy);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.mtc-label {
	display: block;
	font-size: 12px;
	color: #32424f;
	margin: 5px 0;
}

.mtc-label-inline {
	display: inline-block;
	width: 48%;
	margin-right: 2%;
	vertical-align: top;
}

.mtc-input {
	display: block;
	width: 100%;
	margin-top: 3px;
	padding: 6px 8px;
	border: 1px solid var(--mtc-border);
	border-radius: 6px;
	font-size: 12.5px;
	background: #fff;
	color: #1a2433;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mtc-input:focus {
	outline: none;
	border-color: var(--mtc-teal);
	box-shadow: 0 0 0 3px rgba(31, 111, 102, 0.15);
}

.mtc-hint {
	font-size: 11px;
	color: var(--mtc-muted);
	margin: 2px 0 5px;
}

.mtc-radio,
.mtc-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	margin-right: 14px;
	margin-top: 2px;
	cursor: pointer;
}

.mtc-radio input,
.mtc-checkbox input {
	margin: 0;
}

/* Smooth collapse/expand for conditional sections and inline warnings.
   Uses the grid-template-rows 0fr -> 1fr technique so height animates
   without any JS measuring. */
.mtc-collapse {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.28s ease;
}

.mtc-collapse.mtc-open {
	grid-template-rows: 1fr;
}

.mtc-collapse > .mtc-collapse-inner {
	overflow: hidden;
	min-height: 0;
}

.mtc-route-fields {
	margin-top: 10px;
}

.mtc-warning {
	background: var(--mtc-danger-bg);
	border-left: 3px solid var(--mtc-danger);
	color: #8a3d1d;
	border-radius: 6px;
	padding: 6px 9px;
	font-size: 11.5px;
	margin: 5px 0 3px;
}

.mtc-mileage-wrap {
	background: #f7f9fb;
	border: 1px dashed var(--mtc-border);
	border-radius: 6px;
	padding: 7px 9px;
	margin-top: 6px;
}

.mtc-emd-wrap {
	background: #f7f9fb;
	border: 1px dashed var(--mtc-border);
	border-radius: 6px;
	padding: 7px 9px 3px;
	margin-top: 6px;
}

.mtc-tax-header {
	display: grid;
	grid-template-columns: 0.8fr 0.8fr 150px 32px;
	gap: 8px;
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--mtc-muted);
	padding: 0 2px 3px;
}

.mtc-tax-row {
	display: grid;
	grid-template-columns: 0.8fr 0.8fr 150px 32px;
	gap: 8px;
	align-items: center;
	margin-bottom: 5px;
	animation: mtc-fade-in 0.2s ease;
}

.mtc-tax-row .mtc-tax-code,
.mtc-tax-row .mtc-tax-amount,
.mtc-tax-row .mtc-tax-type {
	padding: 5px 7px;
	border: 1px solid var(--mtc-border);
	border-radius: 6px;
	font-size: 12px;
	width: 100%;
	background: #fff;
	color: #1a2433;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mtc-tax-row .mtc-tax-type {
	font-size: 11.5px;
}

.mtc-tax-row input:focus,
.mtc-tax-row select:focus {
	outline: none;
	border-color: var(--mtc-teal);
	box-shadow: 0 0 0 3px rgba(31, 111, 102, 0.15);
}

.mtc-remove-tax {
	background: transparent;
	border: none;
	color: var(--mtc-danger);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	transition: background 0.15s ease;
}

.mtc-remove-tax:hover {
	background: var(--mtc-danger-bg);
}

/* ---------------- Reissue Calculator: simple two-column tax rows ---------------- */

.mtc-simple-tax-header {
	display: grid;
	grid-template-columns: 1fr 1fr 32px;
	gap: 8px;
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--mtc-muted);
	padding: 0 2px 3px;
}

.mtc-simple-tax-row {
	display: grid;
	grid-template-columns: 1fr 1fr 32px;
	gap: 8px;
	align-items: center;
	margin-bottom: 5px;
	animation: mtc-fade-in 0.2s ease;
}

.mtc-simple-tax-row .mtc-simple-tax-code,
.mtc-simple-tax-row .mtc-simple-tax-amount {
	padding: 5px 7px;
	border: 1px solid var(--mtc-border);
	border-radius: 6px;
	font-size: 12px;
	width: 100%;
	background: #fff;
	color: #1a2433;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mtc-simple-tax-row input:focus {
	outline: none;
	border-color: var(--mtc-teal);
	box-shadow: 0 0 0 3px rgba(31, 111, 102, 0.15);
}

.mtc-simple-remove-tax {
	background: transparent;
	border: none;
	color: var(--mtc-danger);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	transition: background 0.15s ease;
}

.mtc-simple-remove-tax:hover {
	background: var(--mtc-danger-bg);
}

.mtc-reissue-subtotal {
	display: flex;
	justify-content: space-between;
	margin-top: 7px;
	padding-top: 7px;
	border-top: 1px dashed var(--mtc-border);
	font-size: 12px;
	font-weight: 600;
	color: var(--mtc-navy);
}

/* ---------------- Reissue Calculator: results ---------------- */

.mtc-reissue-summary {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 4px;
}

.mtc-reissue-summary-col .mtc-result-row {
	font-size: 11px;
	padding: 2px 0;
}

.mtc-reissue-summary-label {
	font-weight: 700;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--mtc-navy);
	margin-bottom: 3px;
}

/* Base fare ADC: always collected in full, never netted against tax
   credits — called out on its own so that's unambiguous at a glance. */
.mtc-fare-adc-box {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	background: var(--mtc-navy);
	color: #fff;
	border-radius: 7px;
	padding: 9px 11px;
	margin: 7px 0 10px;
}

.mtc-fare-adc-label {
	font-size: 12px;
	font-weight: 600;
}

.mtc-fare-adc-hint {
	display: block;
	font-size: 10.5px;
	font-weight: 400;
	color: #b9c6d6;
	margin-top: 1px;
}

.mtc-fare-adc-amount {
	font-size: 15px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Un-used taxes (credit) vs. Requested taxes (new ADC) — two-column
   breakdown that replaces the old single 4-column delta table. */
.mtc-taxlist-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin: 6px 0 4px;
}

.mtc-taxlist-col {
	background: #fff;
	border: 1px solid var(--mtc-border);
	border-radius: 7px;
	padding: 8px 10px 9px;
}

.mtc-taxlist-label {
	font-weight: 700;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	margin-bottom: 1px;
}

.mtc-taxlist-col-unused .mtc-taxlist-label {
	color: var(--mtc-teal);
}

.mtc-taxlist-col-requested .mtc-taxlist-label {
	color: var(--mtc-danger);
}

.mtc-taxlist-hint {
	font-size: 10px;
	color: var(--mtc-muted);
	line-height: 1.35;
	margin-bottom: 6px;
}

.mtc-taxlist-header {
	display: grid;
	grid-template-columns: 1fr 1fr;
	font-size: 9.5px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--mtc-muted);
	padding: 0 0 2px;
}

.mtc-taxlist-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	font-size: 11.5px;
	padding: 2px 0;
	border-bottom: 1px solid #eef1f4;
}

.mtc-taxlist-empty {
	font-size: 11px;
	color: var(--mtc-muted);
	font-style: italic;
	padding: 3px 0;
}

.mtc-taxlist-total {
	display: flex;
	justify-content: space-between;
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px dashed var(--mtc-border);
	font-size: 11.5px;
	font-weight: 700;
	color: var(--mtc-navy);
}

.mtc-credit-note {
	color: var(--mtc-teal);
}

.mtc-btn {
	display: inline-block;
	padding: 7px 14px;
	border-radius: 7px;
	font-size: 12px;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.mtc-btn:active {
	transform: scale(0.97);
}

.mtc-btn-primary {
	background: var(--mtc-navy);
	color: #fff;
	box-shadow: 0 1px 2px rgba(11, 35, 64, 0.15);
}

.mtc-btn-primary:hover {
	background: var(--mtc-navy-light);
}

.mtc-btn-secondary {
	background: #fff;
	color: var(--mtc-navy);
	border-color: var(--mtc-border);
}

.mtc-btn-secondary:hover {
	background: #f2f6f9;
	border-color: #c8d3dd;
}

.mtc-actions {
	display: flex;
	gap: 7px;
	margin-top: 3px;
	flex-wrap: wrap;
}

.mtc-results {
	background: #f7f9fb;
	border: 1px solid var(--mtc-border);
	border-radius: var(--mtc-radius);
	box-shadow: var(--mtc-shadow);
	padding: 12px 14px;
}

.mtc-results h3 {
	margin: 0 0 8px;
	font-size: 13.5px;
	color: var(--mtc-navy);
}

.mtc-result-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 12px;
	padding: 4px 0;
	border-bottom: 1px solid #e6ebef;
}

.mtc-result-row span:first-child {
	color: #3a4a5c;
}

.mtc-out {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	transition: color 0.15s ease;
}

.mtc-subtotal {
	border-bottom: 2px solid var(--mtc-navy);
	font-weight: 600;
}

.mtc-grand-total {
	margin-top: 7px;
	background: var(--mtc-teal-light);
	border: none;
	border-radius: 8px;
	padding: 9px 11px;
	font-size: 14px;
	font-weight: 700;
	color: var(--mtc-teal);
	transition: box-shadow 0.2s ease;
}

@keyframes mtc-pulse-anim {
	0% {
		box-shadow: 0 0 0 0 rgba(31, 111, 102, 0.4);
	}
	70% {
		box-shadow: 0 0 0 9px rgba(31, 111, 102, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(31, 111, 102, 0);
	}
}

.mtc-grand-total.mtc-pulse {
	animation: mtc-pulse-anim 0.7s ease-out;
}

.mtc-owed-total {
	margin-top: 7px;
	background: var(--mtc-danger-bg);
	border: none;
	border-radius: 8px;
	padding: 9px 11px;
	font-size: 13px;
	font-weight: 700;
	color: var(--mtc-danger);
}

.mtc-result-divider {
	height: 1px;
	background: var(--mtc-border);
	margin: 9px 0 6px;
}

.mtc-muted {
	color: var(--mtc-muted);
	font-size: 11.5px;
	border-bottom: none;
}

.mtc-muted .mtc-out {
	font-weight: 500;
}

/* Print: only the ticket reference header + the refund breakdown table. */
@media print {
	.mtc-print-only {
		display: block;
	}

	.mtc-print-header {
		margin-bottom: 16px;
		padding-bottom: 10px;
		border-bottom: 2px solid #0b2340;
	}

	.mtc-print-brand {
		font-weight: 700;
		font-size: 15px;
		color: #0b2340;
	}

	.mtc-print-ticket {
		font-size: 12.5px;
		margin-top: 4px;
	}

	.mtc-print-date {
		font-size: 11px;
		color: #6b7885;
		margin-top: 2px;
	}

	.mtc-no-print,
	.mtc-notice,
	.mtc-col-input,
	.mtc-mode-select {
		display: none !important;
	}

	.mtc-grid {
		display: block;
	}

	.mtc-col-results {
		width: 100%;
		max-width: 100%;
		position: static;
	}

	.mtc-results {
		box-shadow: none;
		border-color: #999;
	}

	.mtc-app,
	.mtc-calculator {
		max-width: 100%;
		animation: none;
	}
}

@media (max-width: 640px) {
	.mtc-label-inline {
		width: 100%;
		margin-right: 0;
	}
	.mtc-tax-header,
	.mtc-tax-row {
		grid-template-columns: 1fr 1fr 110px 28px;
	}
	.mtc-reissue-summary,
	.mtc-taxlist-grid {
		grid-template-columns: 1fr;
	}
	.mtc-fare-adc-box {
		flex-direction: column;
		align-items: flex-start;
		gap: 2px;
	}
}
