/**
 * TrackFlow front-end styles.
 * All selectors are scoped to TrackFlow components so themes stay untouched.
 */

:root {
	--tf-accent: #2563eb;
	--tf-accent-contrast: #ffffff;
}

.tf-track,
.tf-result,
.tf-account,
.tf-multi-results,
.tf-login,
.tf-form-card {
	--tf-ink: #0f172a;
	--tf-muted: #64748b;
	--tf-line: #e2e8f0;
	--tf-surface: #ffffff;
	--tf-soft: #f8fafc;
	--tf-radius: 18px;
	--tf-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.35);
	box-sizing: border-box;
	color: var(--tf-ink);
	font-family: inherit;
	line-height: 1.55;
}

.tf-track *,
.tf-result *,
.tf-account *,
.tf-multi-results *,
.tf-login *,
.tf-form-card * {
	box-sizing: border-box;
}

.tf-track {
	background: var(--tf-surface);
	border: 1px solid var(--tf-line);
	border-radius: var(--tf-radius);
	padding: clamp(20px, 4vw, 34px);
	box-shadow: var(--tf-shadow);
}

.tf-track__title {
	font-size: clamp(1.35rem, 2.4vw, 1.9rem);
	line-height: 1.2;
	margin: 0 0 6px;
	color: var(--tf-ink);
}

.tf-track__intro {
	margin-bottom: 18px;
}

.tf-track__intro p {
	margin: 0;
	color: var(--tf-muted);
}

.tf-track-form__row {
	display: flex;
	gap: 10px;
	align-items: stretch;
}

.tf-track-form__row .tf-input {
	flex: 1 1 auto;
}

.tf-input,
.tf-form-card input[type="text"],
.tf-form-card input[type="email"],
.tf-form-card input[type="tel"],
.tf-form-card input[type="date"],
.tf-form-card input[type="time"],
.tf-form-card input[type="number"],
.tf-form-card select,
.tf-form-card textarea {
	width: 100%;
	min-height: 48px;
	padding: 11px 14px;
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	background: #fff;
	color: var(--tf-ink);
	font: inherit;
	font-size: 15px;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.tf-form-card textarea {
	min-height: 92px;
	resize: vertical;
}

.tf-input:focus,
.tf-form-card input:focus,
.tf-form-card select:focus,
.tf-form-card textarea:focus {
	outline: none;
	border-color: var(--tf-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tf-accent) 18%, transparent);
}

.tf-form-card select {
	background-image: 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='%2364748b' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
}

.tf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 11px 20px;
	border-radius: 12px;
	border: 1px solid transparent;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
	white-space: nowrap;
}

.tf-btn:hover {
	transform: translateY(-1px);
}

.tf-btn:focus-visible {
	outline: 2px solid var(--tf-accent);
	outline-offset: 2px;
}

.tf-btn--primary {
	background: var(--tf-accent);
	color: var(--tf-accent-contrast);
	box-shadow: 0 10px 20px -12px var(--tf-accent);
}

.tf-btn--primary:hover {
	background: color-mix(in srgb, var(--tf-accent) 88%, #000);
}

.tf-btn--ghost {
	background: #fff;
	border-color: #cbd5e1;
	color: var(--tf-ink);
}

.tf-btn--ghost:hover {
	border-color: #94a3b8;
}

.tf-btn--small {
	min-height: 38px;
	padding: 8px 14px;
	font-size: 13px;
}

.tf-help {
	margin: 10px 0 0;
	font-size: 12.5px;
	color: var(--tf-muted);
}

.tf-alert {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 16px;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid #fecaca;
	background: #fef2f2;
	color: #b91c1c;
	font-size: 14px;
}

.tf-alert--success {
	border-color: #bbf7d0;
	background: #f0fdf4;
	color: #15803d;
}

.tf-alert--warning {
	border-color: #fde68a;
	background: #fffbeb;
	color: #b45309;
}

.tf-alert__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	margin-top: 1px;
	border-radius: 50%;
	background: currentColor;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

.tf-muted {
	color: var(--tf-muted);
}

.tf-small {
	font-size: 12.5px;
}

.tf-eyebrow {
	margin: 0 0 4px;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	font-size: 11px;
	font-weight: 700;
	color: var(--tf-muted);
}

.tf-link {
	color: var(--tf-accent);
	text-decoration: none;
	font-weight: 600;
}

.tf-link:hover {
	text-decoration: underline;
}

/* Result card */
.tf-result {
	position: relative;
	margin-top: 24px;
	background: var(--tf-surface);
	border: 1px solid var(--tf-line);
	border-radius: var(--tf-radius);
	padding: clamp(20px, 4vw, 34px);
	box-shadow: var(--tf-shadow);
}

.tf-result__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 18px;
	padding: 0 0 16px;
	border-bottom: 1px solid var(--tf-line);
}

.tf-result__logo {
	display: block;
	flex: 0 0 auto;
	width: auto;
	max-width: 180px;
	height: 46px;
	max-height: 46px;
	object-fit: contain;
}

.tf-result__logo--mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 12px;
	background: var(--tf-accent);
	color: #fff;
}

.tf-result__logo--mark svg {
	width: 31px;
	height: 31px;
}

.tf-result__brand-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.tf-result__brand-name {
	overflow: hidden;
	color: var(--tf-ink);
	font-size: 14px;
	font-weight: 800;
	line-height: 1.25;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tf-result__brand-sub {
	color: var(--tf-muted);
	font-size: 9px;
	font-weight: 600;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-transform: uppercase;
}

.tf-result__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	flex-wrap: wrap;
}

.tf-result__number {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 4px;
	font-size: clamp(1.4rem, 3vw, 2rem);
	font-weight: 800;
	letter-spacing: 0.03em;
	color: var(--tf-ink);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	word-break: break-word;
}

.tf-result__aside {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.tf-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	background: var(--tf-status-color, #64748b);
	color: #fff;
	white-space: nowrap;
}

@supports (color: color-mix(in srgb, red 10%, white)) {
	.tf-status {
		background: color-mix(in srgb, var(--tf-status-color, #64748b) 14%, #fff);
		color: color-mix(in srgb, var(--tf-status-color, #64748b) 62%, #0f172a);
		border: 1px solid color-mix(in srgb, var(--tf-status-color, #64748b) 30%, #fff);
	}
}

.tf-status--muted {
	background: #f1f5f9;
	color: #64748b;
	border-color: #e2e8f0;
}

.tf-copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid var(--tf-line);
	border-radius: 9px;
	background: #fff;
	color: var(--tf-muted);
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.tf-copy:hover {
	color: var(--tf-accent);
	border-color: var(--tf-accent);
}

.tf-route {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 22px 0 6px;
}

.tf-route__point {
	flex: 0 1 auto;
	min-width: 0;
}

.tf-route__point--end {
	text-align: right;
}

.tf-route__label {
	display: block;
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--tf-muted);
	margin-bottom: 2px;
}

.tf-route__point strong {
	display: block;
	font-size: 14px;
	line-height: 1.3;
	color: var(--tf-ink);
	overflow-wrap: anywhere;
}

.tf-route__track {
	position: relative;
	flex: 1 1 auto;
	height: 6px;
	min-width: 60px;
	border-radius: 999px;
	background: #e2e8f0;
}

.tf-route__fill {
	position: absolute;
	inset: 0 auto 0 0;
	border-radius: 999px;
	background: linear-gradient(90deg, color-mix(in srgb, var(--tf-accent) 65%, #fff), var(--tf-accent));
}

.tf-route__pin {
	position: absolute;
	top: 50%;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--tf-accent);
	transform: translate(-50%, -50%);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tf-accent) 22%, transparent);
}

.tf-steps {
	display: flex;
	gap: 4px;
	margin: 22px 0 8px;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: thin;
}

.tf-step {
	position: relative;
	flex: 1 1 0;
	min-width: 64px;
	padding-top: 20px;
	font-size: 11px;
	color: var(--tf-muted);
	text-align: center;
}

.tf-step::before {
	content: "";
	position: absolute;
	top: 7px;
	left: 0;
	right: 0;
	height: 2px;
	background: #e2e8f0;
}

.tf-step:first-child::before {
	left: 50%;
}

.tf-step:last-child::before {
	right: 50%;
}

.tf-step__dot {
	position: absolute;
	top: 0;
	left: 50%;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #cbd5e1;
	transform: translateX(-50%);
}

.tf-step.is-done .tf-step__dot {
	background: var(--tf-accent);
	border-color: var(--tf-accent);
}

.tf-step.is-done::before,
.tf-step.is-current::before {
	background: color-mix(in srgb, var(--tf-accent) 55%, #e2e8f0);
}

.tf-step.is-current .tf-step__dot {
	background: #fff;
	border-color: var(--tf-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--tf-accent) 20%, transparent);
}

.tf-step.is-current {
	color: var(--tf-ink);
	font-weight: 700;
}

.tf-step.is-done {
	color: var(--tf-ink);
}

.tf-result__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin-top: 20px;
}

.tf-panel {
	background: var(--tf-soft);
	border: 1px solid var(--tf-line);
	border-radius: 14px;
	padding: 18px 20px;
}

.tf-panel--wide {
	grid-column: 1 / -1;
}

.tf-panel h3 {
	margin: 0 0 12px;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tf-muted);
}

.tf-dl {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 22px;
	margin: 0;
}

.tf-dl__item dt {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--tf-muted);
	margin-bottom: 2px;
}

.tf-dl__item dd {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--tf-ink);
	overflow-wrap: anywhere;
}

.tf-eta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px dashed #cbd5e1;
}

.tf-eta__label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--tf-muted);
}

.tf-eta__value {
	font-size: 15px;
}

.tf-party p {
	margin: 0 0 3px;
	font-size: 13.5px;
}

.tf-party__name {
	font-weight: 700;
	font-size: 15px !important;
}

.tf-party__company {
	color: var(--tf-muted);
}

.tf-party__line a {
	color: var(--tf-ink);
	text-decoration: none;
}

.tf-party__line a:hover {
	color: var(--tf-accent);
}

.tf-barcode {
	display: flex;
	justify-content: center;
	margin: 22px 0 4px;
	padding: 14px;
	background: #fff;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
	overflow-x: auto;
}

.tf-barcode svg {
	max-width: 100%;
	height: auto;
}

.tf-timeline-section h3 {
	margin: 26px 0 14px;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tf-muted);
}

/* Map */
.tf-map-section {
	margin: 24px 0 4px;
}

.tf-map-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.tf-map-section__head h3 {
	margin: 0;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tf-muted);
}

.tf-map {
	position: relative;
	z-index: 1;
	height: 340px;
	border: 1px solid var(--tf-line);
	border-radius: 14px;
	overflow: hidden;
	background: #e8eef6;
}

.tf-map .leaflet-container {
	font-family: inherit;
	font-size: 12px;
	background: #e8eef6;
}

.tf-map-pin {
	background: transparent;
	border: 0;
}

.tf-map-pin span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 2px solid #fff;
	color: #fff;
	font-size: 11.5px;
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}

.tf-map .marker-cluster,
.tf-map .marker-cluster div {
	background-color: transparent;
}

.tf-map .marker-cluster div {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background: var(--tf-accent);
	color: #fff;
	border: 3px solid #fff;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16), 0 3px 10px rgba(15, 23, 42, 0.35);
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
}

.tf-map .marker-cluster span {
	line-height: 1;
}

.tf-map-stop-label {
	max-width: 190px;
	padding: 3px 7px;
	overflow: hidden;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.97);
	color: #0f172a;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
	text-transform: capitalize;
}

.leaflet-tooltip.tf-map-stop-label::before {
	display: none;
}

/* Give the route map room for country/city labels on wide screens. */
.tf-result {
	left: 50%;
	width: min(94vw, 1040px);
	max-width: none !important;
	transform: translateX(-50%);
}

.tf-map-popup {
	min-width: 140px;
	line-height: 1.5;
}

.tf-map-popup strong {
	display: block;
	font-size: 13px;
	margin-bottom: 2px;
}

.tf-map-date {
	margin-top: 3px;
	color: #64748b;
	font-size: 11.5px;
}

.tf-map-remarks {
	margin-top: 4px;
	color: #475569;
	font-size: 11.5px;
}

.tf-map .leaflet-control-attribution {
	font-size: 9.5px;
}

.tf-timeline {
	position: relative;
	margin: 0;
	padding: 0 0 0 24px;
	list-style: none;
}

.tf-timeline::before {
	content: "";
	position: absolute;
	top: 6px;
	bottom: 10px;
	left: 5px;
	width: 2px;
	background: linear-gradient(#e2e8f0, #f1f5f9);
}

.tf-timeline__item {
	position: relative;
	padding: 0 0 20px;
}

.tf-timeline__dot {
	position: absolute;
	top: 5px;
	left: -24px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--tf-dot, #64748b);
	box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--tf-line);
}

.tf-timeline__top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.tf-timeline__top strong {
	font-size: 14.5px;
}

.tf-timeline__top time {
	font-size: 12px;
	color: var(--tf-muted);
	white-space: nowrap;
}

.tf-timeline__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 3px;
	font-size: 13px;
	color: var(--tf-muted);
}

.tf-timeline__meta a {
	color: var(--tf-muted);
	text-decoration: underline;
	text-decoration-color: #cbd5e1;
}

.tf-pin {
	font-size: 12px;
	line-height: 1;
}

.tf-timeline__remarks {
	margin: 6px 0 0;
	font-size: 13px;
	color: #475569;
}

.tf-result__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--tf-line);
	font-size: 12px;
	color: var(--tf-muted);
}

.tf-result__footer a {
	color: var(--tf-accent);
	text-decoration: none;
	font-weight: 600;
}

/* Multi-track */
.tf-multi-results {
	margin-top: 24px;
	background: var(--tf-surface);
	border: 1px solid var(--tf-line);
	border-radius: var(--tf-radius);
	padding: clamp(18px, 3vw, 28px);
	box-shadow: var(--tf-shadow);
}

.tf-multi-results h2 {
	margin: 0 0 14px;
	font-size: 1.25rem;
}

.tf-track-form textarea.tf-input {
	min-height: 120px;
	margin-bottom: 10px;
}

/* Tables */
.tf-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--tf-line);
	border-radius: 14px;
}

.tf-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
	background: #fff;
}

.tf-table th {
	text-align: left;
	padding: 11px 14px;
	background: var(--tf-soft);
	border-bottom: 1px solid var(--tf-line);
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tf-muted);
	white-space: nowrap;
}

.tf-table td {
	padding: 13px 14px;
	border-bottom: 1px solid #f1f5f9;
	vertical-align: middle;
	color: var(--tf-ink);
}

.tf-table tr:last-child td {
	border-bottom: 0;
}

.tf-packages-panel {
	margin-top: 16px;
}

.tf-package-table input {
	width: 100%;
	min-width: 110px;
	padding: 7px 8px;
	border: 1px solid var(--tf-line);
	border-radius: 7px;
	background: #fff;
	font: inherit;
	font-size: 12.5px;
}

.tf-package-table td:last-child {
	white-space: nowrap;
}

.tf-package-editor .tf-table-wrap {
	margin: 10px 0;
}

.tf-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 700;
	background: var(--tf-badge-color, #64748b);
	color: #fff;
	white-space: nowrap;
}

@supports (color: color-mix(in srgb, red 10%, white)) {
	.tf-badge {
		background: color-mix(in srgb, var(--tf-badge-color, #64748b) 14%, #fff);
		color: color-mix(in srgb, var(--tf-badge-color, #64748b) 62%, #0f172a);
		border: 1px solid color-mix(in srgb, var(--tf-badge-color, #64748b) 28%, #fff);
	}
}

.tf-table__actions {
	white-space: nowrap;
	text-align: right;
}

.tf-table__actions .tf-link + .tf-link {
	margin-left: 12px;
}

/* Account / manager */
.tf-account {
	margin: 0 auto;
}

.tf-section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 18px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.tf-section-head h2 {
	margin: 0 0 4px;
	font-size: clamp(1.3rem, 2.6vw, 1.75rem);
	line-height: 1.2;
	color: var(--tf-ink);
}

.tf-section-head p {
	margin: 0;
}

.tf-section-head__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.tf-filter {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 16px;
	padding: 12px 14px;
	background: var(--tf-soft);
	border: 1px solid var(--tf-line);
	border-radius: 12px;
}

.tf-filter label {
	font-size: 12.5px;
	color: var(--tf-muted);
}

.tf-filter select {
	min-height: 38px;
	padding: 6px 32px 6px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 9px;
	background: #fff;
	font: inherit;
	font-size: 13px;
	color: var(--tf-ink);
}

.tf-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 46px 20px;
	text-align: center;
	background: var(--tf-soft);
	border: 1px dashed #cbd5e1;
	border-radius: 14px;
	color: var(--tf-muted);
}

.tf-empty p {
	margin: 0;
}

.tf-pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 18px;
	flex-wrap: wrap;
}

.tf-pagination a,
.tf-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: 9px;
	border: 1px solid var(--tf-line);
	background: #fff;
	color: var(--tf-ink);
	text-decoration: none;
	font-size: 13px;
}

.tf-pagination .current {
	background: var(--tf-accent);
	border-color: var(--tf-accent);
	color: var(--tf-accent-contrast);
	font-weight: 700;
}

/* Forms */
.tf-form-card {
	margin-top: 4px;
	padding: clamp(18px, 3vw, 30px);
	background: var(--tf-surface);
	border: 1px solid var(--tf-line);
	border-radius: var(--tf-radius);
	box-shadow: var(--tf-shadow);
}

.tf-form-card__tracking {
	margin-bottom: 20px;
	padding-bottom: 18px;
	border-bottom: 1px dashed var(--tf-line);
}

.tf-form-card__tracking label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--tf-muted);
	margin-bottom: 6px;
}

.tf-form-card__readonly {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 800;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	letter-spacing: 0.03em;
}

.tf-form-section {
	margin: 0 0 24px;
	padding: 0;
	border: 0;
}

.tf-form-section legend {
	padding: 0;
	margin-bottom: 12px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--tf-muted);
}

.tf-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 18px;
}

.tf-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.tf-field--textarea,
.tf-field--shipper_address,
.tf-field--receiver_address,
.tf-field--comments {
	grid-column: 1 / -1;
}

.tf-field > label {
	font-size: 13px;
	font-weight: 600;
	color: var(--tf-ink);
}

.tf-required {
	color: #dc2626;
}

.tf-field__description {
	margin: 0;
	font-size: 12px;
	color: var(--tf-muted);
}

.tf-form-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 6px;
}

.tf-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
}

.tf-checkbox input {
	width: 16px;
	height: 16px;
}

.tf-login {
	max-width: 430px;
	margin: 0 auto;
	padding: clamp(22px, 4vw, 34px);
	background: #fff;
	border: 1px solid var(--tf-line);
	border-radius: var(--tf-radius);
	box-shadow: var(--tf-shadow);
}

.tf-login h2 {
	margin: 0 0 6px;
	font-size: 1.4rem;
}

.tf-login form {
	margin-top: 16px;
}

.tf-login form p {
	margin: 0 0 14px;
}

.tf-login label {
	display: block;
	margin-bottom: 4px;
	font-size: 13px;
	font-weight: 600;
}

.tf-login input[type="text"],
.tf-login input[type="password"],
.tf-login input[type="email"] {
	width: 100%;
	min-height: 46px;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	font: inherit;
}

.tf-login input[type="submit"] {
	min-height: 46px;
	padding: 10px 18px;
	border: 0;
	border-radius: 10px;
	background: var(--tf-accent);
	color: var(--tf-accent-contrast);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.tf-login .login-remember label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 400;
}

/* Accessibility helpers */
.tf-track .screen-reader-text,
.tf-account .screen-reader-text,
.tf-multi-results .screen-reader-text,
.tf-result .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 780px) {
	.tf-result__grid,
	.tf-form-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.tf-dl {
		grid-template-columns: minmax(0, 1fr);
	}

	.tf-route {
		align-items: flex-start;
	}

	.tf-route__track {
		margin-top: 16px;
	}

	.tf-route__point--end {
		text-align: left;
	}

	.tf-step {
		min-width: 84px;
	}

	.tf-map {
		height: 280px;
	}
}
@media (max-width: 560px) {
	.tf-track-form__row {
		flex-direction: column;
	}

	.tf-btn {
		width: 100%;
	}

	.tf-result__aside {
		width: 100%;
	}

	.tf-result__aside .tf-btn {
		width: auto;
	}

	.tf-table--shipments thead,
	.tf-table--shipments th {
		display: none;
	}

	.tf-table--shipments,
	.tf-table--shipments tbody,
	.tf-table--shipments tr,
	.tf-table--shipments td {
		display: block;
		width: 100%;
	}

	.tf-table--shipments tr {
		padding: 10px 0;
		border-bottom: 1px solid var(--tf-line);
	}

	.tf-table--shipments td {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 12px;
		border: 0;
		padding: 6px 14px;
		text-align: right;
	}

	.tf-table--shipments td::before {
		content: attr(data-label);
		font-size: 11px;
		text-transform: uppercase;
		letter-spacing: 0.05em;
		color: var(--tf-muted);
		text-align: left;
	}

	.tf-table--shipments td:first-child {
		font-size: 14px;
	}

	.tf-table--shipments__actions {
		justify-content: flex-end !important;
	}

	.tf-table__actions .tf-link + .tf-link {
		margin-left: 10px;
	}

	.tf-section-head__actions .tf-btn {
		width: 100%;
	}

	.tf-multi-results .tf-table thead,
	.tf-multi-results .tf-table th {
		display: none;
	}

	.tf-multi-results .tf-table,
	.tf-multi-results .tf-table tbody,
	.tf-multi-results .tf-table tr,
	.tf-multi-results .tf-table td {
		display: block;
		width: 100%;
	}

	.tf-multi-results .tf-table tr {
		padding: 8px 0;
		border-bottom: 1px solid var(--tf-line);
	}

	.tf-multi-results .tf-table td {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 12px;
		border: 0;
		padding: 6px 14px;
		text-align: right;
	}

	.tf-multi-results .tf-table td::before {
		content: attr(data-label);
		font-size: 11px;
		text-transform: uppercase;
		letter-spacing: 0.05em;
		color: var(--tf-muted);
		text-align: left;
	}
}

/* Live tracking map */
.tf-map-section__head {
	align-items: flex-start;
	margin-bottom: 12px;
}

.tf-map-section__title {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.tf-live {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 9px;
	border: 1px solid #bbf7d0;
	border-radius: 999px;
	background: #f0fdf4;
	color: #15803d;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
}

.tf-live.is-static {
	border-color: var(--tf-line);
	background: var(--tf-soft);
	color: var(--tf-muted);
}

.tf-live__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #10b981;
	box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
	animation: tf-pulse 2s ease-out infinite;
}

.tf-live.is-static .tf-live__dot {
	background: #94a3b8;
	box-shadow: none;
	animation: none;
}

@keyframes tf-pulse {
	0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35); }
	70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
	100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@media (prefers-reduced-motion: reduce) {
	.tf-live__dot {
		animation: none;
	}
}

.tf-map-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.tf-map-stats {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.tf-map-stat {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 76px;
	padding: 6px 11px;
	border: 1px solid var(--tf-line);
	border-radius: 10px;
	background: var(--tf-soft);
}

.tf-map-stat strong {
	font-size: 14px;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.tf-map-stat span {
	font-size: 9px;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--tf-muted);
}

.tf-map-layers {
	display: inline-flex;
	padding: 3px;
	border: 1px solid var(--tf-line);
	border-radius: 10px;
	background: #f1f5f9;
}

.tf-map-layers button {
	padding: 6px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #475569;
	font: inherit;
	font-size: 11.5px;
	font-weight: 600;
	cursor: pointer;
}

.tf-map-layers button.is-active {
	background: #fff;
	color: var(--tf-ink);
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.tf-map-layers button:focus-visible {
	outline: 2px solid var(--tf-accent);
	outline-offset: 1px;
}

.tf-map-layout {
	display: block;
}

.tf-map-panel {
	position: relative;
	min-width: 0;
}

.tf-map {
	height: 380px;
}

.tf-map-current {
	position: absolute;
	left: 12px;
	top: 78px;
	z-index: 600;
	display: flex;
	flex-direction: column;
	gap: 2px;
	max-width: calc(100% - 60px);
	padding: 9px 12px;
	border: 1px solid var(--tf-line);
	border-radius: 11px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
	backdrop-filter: blur(4px);
	pointer-events: none;
}

.tf-map-current__eyebrow {
	font-size: 8.5px;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--tf-muted);
}

.tf-map-current strong {
	max-width: 230px;
	font-size: 12.5px;
	line-height: 1.3;
	text-transform: capitalize;
}

.tf-map-current .tf-badge {
	align-self: flex-start;
	margin-top: 2px;
}

.tf-map-current time {
	font-size: 9.5px;
	color: var(--tf-muted);
}

.tf-map-list-panel {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 650;
	width: 250px;
	max-height: calc(100% - 24px);
	overflow: hidden;
	border: 1px solid var(--tf-line);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.97);
	box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
}

.tf-map-list-panel:not([open]) {
	width: auto;
}

.tf-map-list-panel[open] {
	display: flex;
	flex-direction: column;
}

.tf-map-list-panel > summary {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	padding: 9px 12px;
	color: var(--tf-muted);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	list-style: none;
	cursor: pointer;
	user-select: none;
}

.tf-map-list-panel > summary::-webkit-details-marker {
	display: none;
}

.tf-map-list-panel > summary > span:first-child {
	flex: 1 1 auto;
}

.tf-map-list-panel__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--tf-accent);
	color: var(--tf-accent-contrast);
	font-size: 10px;
	letter-spacing: 0;
}

.tf-map-list-panel > summary::after {
	content: "−";
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
}

.tf-map-list-panel:not([open]) > summary::after {
	content: "+";
}

.tf-map-list-panel .tf-map-list {
	flex: 1 1 auto;
	min-height: 0;
	max-height: 310px;
	border: 0;
	border-radius: 0;
	background: transparent;
}

.tf-map-list {
	max-height: 310px;
	margin: 0;
	padding: 0;
	overflow: auto;
	border: 1px solid var(--tf-line);
	border-radius: 14px;
	background: #fff;
	list-style: none;
	scrollbar-width: thin;
}

.tf-map-list li + li {
	border-top: 1px solid #f1f5f9;
}

.tf-map-list__item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	padding: 10px 12px;
	border: 0;
	background: transparent;
	color: var(--tf-ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: background 0.12s ease;
}

.tf-map-list__item:hover {
	background: #f8fafc;
}

.tf-map-list__item.is-current {
	background: #f0fdfa;
	background: color-mix(in srgb, var(--tf-accent) 7%, #fff);
}

.tf-map-list__item.is-active {
	background: #ecfeff;
	background: color-mix(in srgb, var(--tf-accent) 12%, #fff);
}

.tf-map-list__item:focus-visible {
	outline: 2px solid var(--tf-accent);
	outline-offset: -2px;
}

.tf-map-list__index {
	flex: 0 0 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin-top: 1px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--tf-point-color, #64748b);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
}

.tf-map-list__body {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.tf-map-list__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
}

.tf-map-list__row strong {
	font-size: 12.5px;
	line-height: 1.3;
}

.tf-map-list__row time {
	flex: 0 0 auto;
	font-size: 9.5px;
	color: var(--tf-muted);
	white-space: nowrap;
}

.tf-map-list__location {
	font-size: 11.5px;
	color: #334155;
	overflow-wrap: anywhere;
}

.tf-map-list__remarks {
	display: -webkit-box;
	overflow: hidden;
	font-size: 11px;
	color: var(--tf-muted);
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.tf-timeline-details {
	margin-top: 24px;
	padding-top: 10px;
	border-top: 1px solid var(--tf-line);
}

.tf-timeline-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 7px 0;
	color: var(--tf-muted);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	list-style: none;
	cursor: pointer;
}

.tf-timeline-details > summary::-webkit-details-marker {
	display: none;
}

.tf-timeline-details > summary::after {
	content: "+";
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	color: var(--tf-muted);
}

.tf-timeline-details[open] > summary::after {
	content: "−";
}

.tf-timeline-details .tf-timeline {
	margin-top: 10px;
}

@media (max-width: 900px) {
	.tf-map-list-panel {
		position: static;
		width: auto;
		max-height: none;
		margin-top: 12px;
		background: #fff;
	}

	.tf-map-list-panel .tf-map-list {
		max-height: 250px;
	}

	.tf-map {
		height: 320px;
	}
}

@media (max-width: 560px) {
	.tf-map-current {
		display: none;
	}

	.tf-map {
		height: 280px;
	}

	.tf-map-stats {
		width: 100%;
	}

	.tf-map-stat {
		flex: 1 1 0;
		min-width: 0;
	}

	.tf-map-toolbar {
		align-items: stretch;
	}

	.tf-map-layers {
		align-self: flex-start;
	}
}

@media (max-width: 700px) {
	.tf-package-list thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.tf-package-list,
	.tf-package-list tbody,
	.tf-package-list tr,
	.tf-package-list td {
		display: block;
		width: 100%;
	}

	.tf-package-list tr {
		padding: 10px 12px;
		border-bottom: 1px solid #f1f5f9;
	}

	.tf-package-list tr:last-child {
		border-bottom: 0;
	}

	.tf-package-list td {
		display: flex;
		justify-content: space-between;
		gap: 16px;
		padding: 4px 0;
		border: 0;
		text-align: right;
	}

	.tf-package-list td::before {
		content: attr(data-label);
		color: var(--tf-muted);
		font-size: 9px;
		font-weight: 700;
		letter-spacing: 0.06em;
		text-transform: uppercase;
	}
}
