html:has(.travel-calculator) {
	scroll-behavior: smooth;
}

.travel-calculator {
	--travel-green: #198754;
	--travel-soft: #edf8f2;
}

.travel-calculator .card {
	border-radius: 0.8rem;
}

.travel-calculator .card-header {
	border-bottom: 1px solid #e9ecef;
}

.step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.8rem;
	height: 1.8rem;
	margin-right: 0.45rem;
	border-radius: 50%;
	background: var(--travel-green);
	color: #fff;
	font-size: 0.85rem;
}

.travel-quicknav {
	position: sticky;
	top: 0;
	z-index: 1030;
	margin: 0 0 1.5rem;
	background: #fff;
	border: 1px solid #e9ecef;
	border-radius: 0.8rem;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.travel-quicknav-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	overflow-x: auto;
	padding: 0.9rem 1rem;
}

.travel-quicknav-link {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	padding: 0.75rem 1.5rem;
	border: 1px solid var(--travel-green);
	border-radius: 999px;
	background: var(--travel-soft);
	color: var(--travel-green);
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.travel-quicknav-link:hover,
.travel-quicknav-link:focus-visible {
	background: var(--travel-green);
	color: #fff;
}

.travel-quicknav-action {
	background: var(--travel-green);
	color: #fff;
}

.travel-quicknav-action:hover,
.travel-quicknav-action:focus-visible {
	background: #146c43;
	border-color: #146c43;
	color: #fff;
}

#travelSectionBasic,
#travelSectionTransport,
#travelSectionEtc {
	scroll-margin-top: 5.75rem;
}

/*
 * 날짜 칸: 직접 타이핑(.date-input) + 달력 버튼(.date-picker-open).
 * 네이티브 <input type="date">(.date-picker-native)는 달력 UI만 빌려쓰려고
 * 숨겨두되, showPicker() 가 뜰 위치를 잡아야 하므로 display:none 대신
 * 크기 0 으로 버튼 아래에 겹쳐둔다 (display:none 이면 브라우저가 팝업을 못 띄운다).
 */
.date-picker-group {
	position: relative;
	flex-wrap: nowrap;
}

.date-picker-native {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 1px;
	height: 1px;
	padding: 0;
	border: 0;
	opacity: 0;
	pointer-events: none;
}

.expense-table th:first-child {
	min-width: 5rem;
}

.expense-table td:nth-child(2),
.expense-table td:nth-child(3) {
	min-width: 9rem;
}

.result-card {
	position: static;
	overflow: hidden;
}

/*
 * 우측 "금액 및 최종 지급액" 카드를 상단 고정 메뉴(.travel-quicknav) 바로 아래에 붙여
 * 스크롤을 따라오게 한다. sticky 는 "부모가 자신보다 커야" 움직일 여지가 생기므로,
 * 컬럼(.result-col)에 align-self: stretch 를 유지해 행 전체 높이를 갖게 해야 한다
 * (.row 에 align-items-start 를 주면 컬럼이 카드 높이로 줄어 sticky 가 죽는다).
 */
@media (min-width: 768px) {
	.result-col {
		align-self: stretch;
	}

	.result-card {
		position: sticky;
		top: 5.75rem;
		max-height: calc(100vh - 7rem);
		overflow-y: auto;
	}
}

.result-header {
	background: var(--travel-green);
	color: #fff;
}

.statement-info > div,
.summary-lines > div {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.55rem 0;
	border-bottom: 1px dashed #dee2e6;
}

.result-card .summary-lines {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
}

.lodging-limit-guide {
	line-height: 1.45;
}

.remarks-template {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.25rem;
	overflow-x: auto;
	white-space: nowrap;
}

.remarks-template .remarks-input-name {
	display: inline-block;
	flex: 0 0 auto;
	width: 6rem;
}

.remarks-template .remarks-input-count {
	display: inline-block;
	flex: 0 0 auto;
	width: 4.5rem;
}

.remarks-template .remarks-amount-display {
	display: inline-block;
	flex: 0 0 auto;
	min-width: 4.5rem;
	padding: 0.15rem 0.5rem;
	border-radius: 0.25rem;
	background: #e9ecef;
	color: #495057;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.remarks-row th {
	vertical-align: middle;
}

.result-card .total-box {
	max-width: none;
}

.statement-info dt {
	flex: 0 0 4rem;
	color: #6c757d;
	font-weight: 500;
}

.statement-info dd {
	margin: 0;
	text-align: right;
	word-break: keep-all;
}

.total-box {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.1rem;
	border-radius: 0.75rem;
	background: var(--travel-soft);
	color: #146c43;
}

.total-box strong {
	font-size: 1.55rem;
}

.fuel-type-col {
	flex: 0 0 auto;
}

#fuelType {
	width: 18rem;
	max-width: 100%;
}

.fuel-price-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	align-items: end;
}

.fuel-price-item {
	display: grid;
	gap: 0.15rem;
	flex: 0 0 auto;
	width: max-content;
}

.fuel-price-item .form-label {
	display: block;
	margin-bottom: 0 !important;
	text-align: center;
}

.fuel-price-item .input-group {
	width: auto;
	flex-wrap: nowrap;
}

.fuel-price-static {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.25rem;
	min-width: 7.4rem;
	padding: 0.25rem 0.45rem;
	border: 1px solid #dee2e6;
	border-radius: 0.375rem;
	background: #fff;
	color: #212529;
	font-size: 0.875rem;
	line-height: 1.5;
}

.fuel-price-static > span:first-child {
	min-width: 7.2ch;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.fuel-price-unit {
	color: #6c757d;
	white-space: nowrap;
}

.fuel-price-item .form-control {
	width: 7.2ch;
	min-width: 7.2ch;
	padding-left: 0.35rem;
	padding-right: 0.35rem;
	text-align: right;
}

.fuel-price-item .input-group-text {
	padding-left: 0.35rem;
	padding-right: 0.35rem;
	white-space: nowrap;
}

.transport-detail {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.3rem 0;
}

.transport-source-detail {
	margin: -0.15rem 0 0.25rem;
	text-align: right;
}

.fare-source {
	margin-top: 0.2rem;
	line-height: 1.2;
}

.transport-row-message {
	grid-column: 1 / -1 !important;
	width: 100%;
	margin-top: -0.15rem;
	padding: 0.45rem 0.65rem;
	border-radius: 0.5rem;
	background: #f8f9fa;
	color: #495057;
	line-height: 1.35;
	white-space: nowrap;
	overflow-x: auto;
}

.transport-row-message.is-warning {
	background: #fff3cd;
	color: #664d03;
}

.transport-row-message.is-danger {
	background: #f8d7da;
	color: #842029;
}

.fare-source a {
	text-decoration: none;
}

.transport-guide a,
.fare-source a,
.transport-source-detail a {
	color: #0d6efd;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.transport-guide a:hover,
.fare-source a:hover,
.transport-source-detail a:hover {
	color: #0a58ca;
}

.transport-table-wrap {
	padding-bottom: 0.25rem;
}

.transport-grid {
	display: grid;
	grid-template-columns: 9rem 7rem minmax(7rem, 1fr) minmax(7rem, 1fr) 6rem 8rem 7rem 2.25rem;
	gap: 0.5rem;
	min-width: 880px;
}

.transport-head > div {
	padding: 0 0.25rem;
}

.note-output {
	white-space: pre-wrap;
}

.print-only {
	display: none;
}

@media (max-width: 575.98px) {
	.fuel-type-col,
	#fuelType {
		width: 100%;
	}

	.result-card .summary-lines {
		grid-template-columns: 1fr;
	}

	.result-card .total-box {
		max-width: none;
	}

	.transport-row .form-control,
	.transport-row .form-select {
		font-size: 0.83rem;
		padding-left: 0.45rem;
		padding-right: 0.45rem;
	}
}

@media (min-width: 576px) and (max-width: 767.98px) {
	.result-card .summary-lines {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.transport-row.loading-route {
	opacity: 0.65;
	position: relative;
}
.transport-row.loading-route input,
.transport-row.loading-route select {
	cursor: wait;
}

.place-input {
	cursor: pointer;
}

.place-address {
	line-height: 1.35;
}

.place-picker-map {
	width: 100%;
	min-height: 480px;
	border: 1px solid #dee2e6;
	border-radius: 0.75rem;
	overflow: hidden;
	background: #f8f9fa;
}

.place-results {
	max-height: 480px;
	overflow-y: auto;
}

.place-result-item {
	text-align: left;
}

html[data-theme='dark'] .travel-calculator {
	--travel-soft: rgb(25 135 84 / 0.16);
	color: var(--color-fg);
}

html[data-theme='dark'] .travel-calculator .card {
	background-color: var(--color-surface);
	border-color: var(--color-border);
	color: var(--color-fg);
}

html[data-theme='dark'] .travel-quicknav {
	background-color: var(--color-surface);
	border-color: var(--color-border);
}

html[data-theme='dark'] .travel-calculator .card-header {
	background-color: var(--color-surface) !important;
	border-bottom-color: var(--color-border);
	color: var(--color-fg);
}

html[data-theme='dark'] .travel-calculator .form-control,
html[data-theme='dark'] .travel-calculator .form-select {
	background-color: var(--color-surface-2);
	border-color: var(--color-border);
	color: var(--color-fg);
}

html[data-theme='dark'] .travel-calculator .form-control:focus,
html[data-theme='dark'] .travel-calculator .form-select:focus {
	background-color: var(--color-surface-2);
	border-color: var(--color-primary);
	color: var(--color-fg);
	box-shadow: 0 0 0 0.2rem rgb(25 135 84 / 0.25);
}

html[data-theme='dark'] .travel-calculator .form-control::placeholder {
	color: var(--color-fg-subtle);
}

html[data-theme='dark'] .travel-calculator .input-group-text,
html[data-theme='dark'] .travel-calculator .fuel-price-static,
html[data-theme='dark'] .travel-calculator .remarks-amount-display {
	background-color: var(--color-surface-2);
	border-color: var(--color-border);
	color: var(--color-fg);
}

html[data-theme='dark'] .travel-calculator .fuel-price-unit,
html[data-theme='dark'] .travel-calculator .text-muted,
html[data-theme='dark'] .travel-calculator .form-text,
html[data-theme='dark'] .travel-calculator .station-hint,
html[data-theme='dark'] .travel-calculator .bus-hint {
	color: var(--color-fg-muted) !important;
}

html[data-theme='dark'] .travel-calculator .bg-light {
	background-color: var(--color-surface-2) !important;
}

html[data-theme='dark'] .travel-calculator .table {
	--bs-table-bg: transparent;
	--bs-table-color: var(--color-fg);
	--bs-table-border-color: var(--color-border);
	color: var(--color-fg);
}

html[data-theme='dark'] .travel-calculator .summary-lines > div,
html[data-theme='dark'] .travel-calculator .statement-info > div {
	border-bottom-color: var(--color-border);
}

html[data-theme='dark'] .travel-calculator .total-box {
	background: var(--travel-soft);
	color: #6ee7b7;
}

html[data-theme='dark'] .travel-calculator .alert-warning {
	background-color: rgb(234 179 8 / 0.12);
	border-color: rgb(234 179 8 / 0.28);
	color: #fde68a;
}

html[data-theme='dark'] .travel-calculator .modal-content,
html[data-theme='dark'] .travel-calculator .list-group-item {
	background-color: var(--color-surface);
	border-color: var(--color-border);
	color: var(--color-fg);
}

html[data-theme='dark'] .travel-calculator .list-group-item.active {
	background-color: var(--travel-green);
	border-color: var(--travel-green);
	color: #fff;
}

html[data-theme='dark'] .travel-calculator .place-picker-map {
	border-color: var(--color-border);
	background-color: var(--color-surface-2);
}

html[data-theme='dark'] .travel-calculator .transport-row-message {
	background-color: var(--color-surface-2);
	color: var(--color-fg-muted);
}

html[data-theme='dark'] .travel-calculator .transport-row-message.is-warning {
	background-color: rgb(234 179 8 / 0.14);
	color: #fde68a;
}

html[data-theme='dark'] .travel-calculator .transport-row-message.is-danger {
	background-color: rgb(239 68 68 / 0.14);
	color: #fecaca;
}

html[data-theme='dark'] .transport-guide a,
html[data-theme='dark'] .fare-source a,
html[data-theme='dark'] .transport-source-detail a {
	color: var(--color-link);
}

html[data-theme='dark'] .transport-guide a:hover,
html[data-theme='dark'] .fare-source a:hover,
html[data-theme='dark'] .transport-source-detail a:hover {
	color: var(--color-link-hover);
}

@media print {
	@page { size: A4; margin: 16mm; }

	html,
	body {
		margin: 0 !important;
		padding: 0 !important;
	}

	body > .container:not(#travelCalculator),
	body > .container:has(.site-footer),
	body > iframe,
	.hub-header,
	.v1-mainnav,
	.site-footer,
	.no-print {
		display: none !important;
	}

	.print-only {
		display: block !important;
	}

	.travel-calculator {
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.official-form {
		position: relative;
		box-sizing: border-box;
		width: 100%;
		height: 263mm;
		color: #000;
		font-family: "Batang", "바탕", "Noto Serif KR", serif;
		font-size: 10.5pt;
		line-height: 1.45;
	}

	.official-reference {
		margin: 0 0 7mm;
		font-size: 9.5pt;
	}

	.official-form h1 {
		margin: 0 0 10mm;
		font-family: "Malgun Gothic", "맑은 고딕", sans-serif;
		font-size: 21pt;
		font-weight: 700;
		text-align: center;
	}

	.official-system-note {
		margin: 0 0 3mm;
		font-size: 9pt;
	}

	.official-table {
		width: 100%;
		margin: 0 0 3mm;
		border-collapse: collapse;
		table-layout: fixed;
	}

	.official-table th,
	.official-table td {
		border: 0.6pt solid #555;
		padding: 2mm 1.5mm;
		font-weight: 400;
		text-align: center;
		vertical-align: middle;
		word-break: keep-all;
	}

	.identity-table th { width: 14%; }
	.identity-table td { width: 19.33%; height: 12mm; }
	.schedule-table .side-label,
	.lodging-table .side-label,
	.fare-table .side-label { width: 14%; }
	.schedule-table th:not(.side-label) { width: 14%; }
	.schedule-table td { height: 11mm; }
	.lodging-table th:not(.side-label) { width: 14%; }
	.lodging-table td { height: 22mm; }
	.fare-table th:not(.side-label) { width: 14.33%; }
	.fare-table .fare-print-row td {
		height: 11mm;
		padding: 1.5mm 1mm;
		font-size: 9pt;
		line-height: 1.25;
		overflow-wrap: anywhere;
		word-break: break-all;
		white-space: normal;
	}
	.fare-table .fare-print-row td:nth-child(3),
	.fare-table .fare-print-row td:nth-child(4) {
		font-size: 8pt;
	}

	.official-declaration {
		margin: 8mm 4mm 0;
		font-size: 10.5pt;
	}

	.official-declaration > p:first-child {
		margin-bottom: 6mm;
		text-indent: 0.7em;
	}

	.official-date {
		margin: 10mm 0 6mm;
		text-align: right;
	}

	.official-applicant {
		margin: 0 0 7mm;
		text-align: right;
	}

	.official-recipient {
		margin: 0 0 9mm;
		font-size: 14pt;
		font-weight: 700;
	}

	.official-recipient span {
		font-size: 10pt;
		font-weight: 400;
	}

	.official-recipient #printRecipient {
		font-size: 16pt;
		font-weight: 700;
	}

	.official-notes {
		border-top: 2pt solid #999;
		border-bottom: 0.6pt solid #777;
		font-size: 8.5pt;
	}

	.official-notes > div {
		padding: 1.5mm;
		background: #eee !important;
		text-align: center;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	.official-notes ol {
		margin: 3mm 0 3mm 7mm;
		padding-left: 5mm;
	}

	.official-paper {
		position: absolute;
		right: 0;
		bottom: 0;
		font-size: 8pt;
		text-align: right;
	}

	.settlement-detail {
		position: relative;
		box-sizing: border-box;
		width: 100%;
		height: 263mm;
		break-before: page;
		page-break-before: always;
		color: #000;
		font-family: "Malgun Gothic", "맑은 고딕", sans-serif;
		font-size: 9pt;
		line-height: 1.4;
	}

	.settlement-detail h1 {
		margin: 0 0 2mm;
		font-size: 20pt;
		font-weight: 700;
		text-align: center;
	}

	.detail-subtitle {
		margin: 0 0 4mm;
		color: #444;
		font-size: 9pt;
		text-align: center;
	}

	.settlement-detail h2 {
		margin: 4mm 0 1.5mm;
		font-size: 11pt;
		font-weight: 700;
	}

	.detail-section-heading {
		display: flex;
		align-items: end;
		justify-content: space-between;
		gap: 4mm;
		margin: 4mm 0 1.5mm;
	}

	.detail-section-heading h2 {
		margin: 0;
	}

	#detailFuelSourceSummary {
		font-size: 7.5pt;
		font-weight: 400;
		color: #555;
		text-align: right;
		white-space: nowrap;
	}

	.detail-table {
		width: 100%;
		border-collapse: collapse;
		table-layout: fixed;
	}

	.detail-table th,
	.detail-table td {
		border: 0.6pt solid #555;
		padding: 2mm 1.5mm;
		vertical-align: middle;
		overflow-wrap: anywhere;
		word-break: break-all;
	}

	.detail-table th {
		background: #f0f0f0 !important;
		font-weight: 600;
		text-align: center;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	.detail-info-table th { width: 10%; }
	.detail-info-table td { height: 9mm; }
	/* 합계 100% — 글자를 키운 만큼 산출식 칸에서 덜어 나머지 칸에 배분 */
	.detail-date-col { width: 9%; }
	.detail-type-col { width: 8%; }
	.detail-route-col { width: 20%; }
	.detail-calc-col { width: 27%; }
	.detail-money-col { width: 12%; }
	.detail-transport-table th,
	.detail-transport-table td {
		padding: 1mm 0.7mm;
		font-size: 8pt;
		line-height: 1.25;
	}
	.detail-transport-table td:nth-child(5),
	.detail-transport-table td:nth-child(6),
	.detail-transport-table td:nth-child(7),
	.detail-transport-table tfoot td {
		text-align: right;
		white-space: nowrap;
	}
	.detail-transport-table tfoot th,
	.detail-transport-table tfoot td { font-weight: 700; }
	.detail-empty { height: 12mm; color: #666; text-align: center !important; }
	.detail-expense-table th:first-child { width: 16%; }
	.detail-expense-table th:last-child { width: 20%; }
	.detail-expense-table td:last-child { font-weight: 600; text-align: right; }
	.detail-limit-note { margin: 2mm 0 0; font-size: 8pt; }
	.detail-remarks-note {
		margin: 1.5mm 0 0;
		padding: 1.5mm 2mm;
		border: 0.6pt dashed #888;
		font-size: 8pt;
		line-height: 1.35;
		white-space: pre-wrap;
		overflow-wrap: anywhere;
	}

	.detail-grand-total {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 5mm;
		padding: 3mm 5mm;
		border: 1.2pt solid #333;
		font-size: 13pt;
		font-weight: 700;
	}

	.detail-grand-total strong { font-size: 17pt; }
	.detail-source-note {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		padding-top: 3mm;
		border-top: 0.6pt solid #999;
		font-size: 7.5pt;
		color: #444;
	}
	.detail-source-note p { margin: 1mm 0 0; }
}
