@charset "utf-8";

/*
 * 配送支援システム 共通スタイル
 *
 * NOTE:
 * - ベースデザインは `/_reference/design/*.html` の <style> を移植し、共通化したもの。
 * - 画面ごとの微調整は `body` のクラス（例: `page-login`）で切り替える。
 */

:root {
	--primary: #1a56db;
	--primary-light: #3b82f6;
	--primary-bg: #eff6ff;
	--secondary: #059669;
	--secondary-bg: #ecfdf5;
	--warning: #d97706;
	--warning-bg: #fffbeb;
	--danger: #dc2626;
	--danger-bg: #fef2f2;
	--surface: #ffffff;
	--surface-elevated: #f8fafc;
	--border: #e2e8f0;
	--border-focus: #3b82f6;
	--text-primary: #1e293b;
	--text-secondary: #64748b;
	--text-muted: #94a3b8;
	--radius-sm: 6px;
	--radius-md: 10px;
	--radius-lg: 16px;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
	--shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
	--transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
	font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
	background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
	min-height: 100vh;
	color: var(--text-primary);
	line-height: 1.6;
}

/* Container */
.container {
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px 20px 40px;
}

/* Header */
.header {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	margin-bottom: 16px;
	padding: 6px 0;
}
.header-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--text-primary);
	text-decoration: none;
	font-weight: 700;
	font-size: 22px;
}
.header-brand-icon {
	font-size: 26px;
	line-height: 1;
}
.header-brand-text {
	letter-spacing: 1px;
}
.header-brand:hover,
.header-brand:focus,
.header-brand:active {
	text-decoration: none;
}

/* Top Tabs */
.stepper {
	display: flex;
	justify-content: space-between;
	gap: 0;
	margin-bottom: 40px;
	flex-wrap: nowrap;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
}

.step {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 16px;
	background: transparent;
	font-size: 13px;
	font-weight: 600;
	color: var(--text-secondary);
	border-right: 1px solid var(--border);
	transition: var(--transition);
	cursor: pointer;
	position: relative;
	user-select: none;
}
.step:last-child { border-right: none; }
.step::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: transparent;
	transition: var(--transition);
}
.step.active { background: var(--primary-bg); color: var(--primary); }
.step.active::after { background: var(--primary); }
.step.completed { background: var(--secondary-bg); color: var(--secondary); }
.step.completed::after { background: var(--secondary); }

/* Section Cards */
.section {
	background: var(--surface);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
	margin-bottom: 24px;
	overflow: hidden;
	border: 1px solid var(--border);
}
.section-header {
	padding: 20px 28px;
	background: linear-gradient(to right, var(--surface-elevated), var(--surface));
	border-bottom: 1px solid var(--border);
	display: flex;
	align-items: center;
	gap: 12px;
}
.section-icon {
	width: 40px;
	height: 40px;
	border-radius: var(--radius-md);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
}
.section-icon.blue { background: var(--primary-bg); }
.section-icon.green { background: var(--secondary-bg); }
.section-icon.orange { background: var(--warning-bg); }
.section-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.section-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.section-body { padding: 28px; }

/* Form Grid */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* Form Group */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
	font-size: 13px;
	font-weight: 500;
	color: var(--text-secondary);
	display: flex;
	align-items: center;
	gap: 6px;
}
.required { color: #ef4444; font-size: 10px; }

.form-input,
.form-select,
.form-textarea {
	padding: 12px 14px;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 14px;
	font-family: inherit;
	transition: var(--transition);
	background: var(--surface);
	width: 100%;
}
.form-textarea { resize: vertical; min-height: 80px; }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
	outline: none;
	border-color: var(--border-focus);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

/* ------------------------------------------------------------
 * 入力 UI 部品（地図作成依頼書）
 * - 参照: /_reference/design/地図作成依頼書_情報登録.html
 * - /request/regist を中心に利用するが、共通部品として全体へ提供する
 * ------------------------------------------------------------ */

/* Input with suffix (例: 「店」など) */
.input-with-suffix { display: flex; align-items: stretch; }
.input-with-suffix .form-input {
	border-radius: var(--radius-sm) 0 0 var(--radius-sm);
	border-right: none;
}
.input-with-suffix .autocomplete-wrap .form-input {
	border-radius: var(--radius-sm) 0 0 var(--radius-sm);
	border-right: none;
}
.input-suffix {
	padding: 12px 14px;
	background: var(--surface-elevated);
	border: 1.5px solid var(--border);
	border-left: none;
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	color: var(--text-secondary);
	font-size: 14px;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
}

/* Checkbox inline */
.checkbox-inline {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 12px 16px;
	background: var(--primary-bg);
	border-radius: var(--radius-sm);
	cursor: pointer;
}
.checkbox-inline input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--primary);
}
.checkbox-inline span { font-size: 13px; color: var(--text-primary); }

/* Toggle group (有/無) */
.toggle-group {
	background: var(--surface-elevated);
	border-radius: var(--radius-md);
	padding: 16px 20px;
	border: 1px solid var(--border);
}
.toggle-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle-title {
	font-size: 14px;
	font-weight: 500;
	color: var(--text-primary);
	display: flex;
	align-items: center;
	gap: 8px;
}
.toggle-title .number {
	width: 22px;
	height: 22px;
	background: var(--primary);
	color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 600;
}
.radio-toggle {
	display: flex;
	background: var(--border);
	border-radius: 50px;
	padding: 3px;
	gap: 2px;
	user-select: none;
}
.radio-toggle label {
	padding: 8px 20px;
	border-radius: 50px;
	font-size: 13px;
	font-weight: 500;
	color: var(--text-muted);
	cursor: pointer;
	transition: var(--transition);
	text-align: center;
}
.radio-toggle input { display: none; }
.radio-toggle input:checked + label {
	background: white;
	color: var(--text-primary);
	box-shadow: var(--shadow-sm);
}
.radio-toggle input[value="1"]:checked + label {
	background: var(--primary);
	color: white;
}
.toggle-content {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease, margin-top 0.3s ease, padding-top 0.3s ease;
}
.toggle-content.visible {
	max-height: 520px;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px dashed var(--border);
}

/* Sub sections */
.subsection {
	background: var(--surface-elevated);
	border-radius: var(--radius-md);
	padding: 20px;
	margin-top: 20px;
	border: 1px solid var(--border);
}
.subsection-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 16px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.subsection-number {
	width: 22px;
	height: 22px;
	background: var(--primary);
	color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 600;
}

/* Radio cards */
.radio-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
}
.radio-card { position: relative; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card-content {
	padding: 16px;
	background: var(--surface);
	border: 2px solid var(--border);
	border-radius: var(--radius-md);
	text-align: center;
	transition: var(--transition);
}
.radio-card:hover .radio-card-content { border-color: var(--text-muted); }
.radio-card input:checked + .radio-card-content {
	border-color: var(--primary);
	background: var(--primary-bg);
}
.radio-card-icon { font-size: 28px; margin-bottom: 8px; }
.radio-card-label { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.radio-card-desc { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Inline radio for sub-options */
.inline-radio-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.inline-radio {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: var(--surface);
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: var(--transition);
	font-size: 13px;
}
.inline-radio:hover { border-color: var(--text-muted); }
.inline-radio input { display: none; }
.inline-radio.selected { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }

/* Conditional sections */
.conditional-section {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease, margin-top 0.3s ease;
	margin-top: 0;
}
.conditional-section.visible { max-height: 520px; margin-top: 16px; }

/* Vehicle grid */
.vehicle-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	gap: 10px;
}
.vehicle-checkbox { position: relative; cursor: pointer; }
.vehicle-checkbox input { position: absolute; opacity: 0; }
.vehicle-content {
	padding: 12px;
	background: var(--surface);
	border: 2px solid var(--border);
	border-radius: var(--radius-sm);
	text-align: center;
	transition: var(--transition);
	font-size: 12px;
	font-weight: 500;
}
.vehicle-checkbox:hover .vehicle-content { border-color: var(--text-muted); }
.vehicle-checkbox input:checked + .vehicle-content {
	border-color: var(--secondary);
	background: var(--secondary-bg);
	color: var(--secondary);
}
.vehicle-content.passable {
	background: #fef9c3;
	border-color: #eab308;
	color: #a16207;
}
.vehicle-checkbox input:checked + .vehicle-content.passable {
	border-color: var(--secondary);
	background: var(--secondary-bg);
	color: var(--secondary);
}
.vehicle-content .icon {
	font-size: 20px;
	margin-bottom: 4px;
	display: block;
}
.vehicle-content .icon img {
	width: 48px;
	height: 28px;
	object-fit: contain;
	display: inline-block;
}
.vehicle-content .icon svg {
	width: 1.3em;
	height: 1.3em;
	display: inline-block;
	vertical-align: -0.2em;
}

/* Width guide (legend) */
.width-guide { display: flex; gap: 16px; flex-wrap: wrap; }
.width-guide-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 20px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	flex: 1;
	min-width: 160px;
}
.width-guide-color {
	width: 24px;
	height: 24px;
	border-radius: 4px;
	flex-shrink: 0;
	border: 1px solid var(--border);
}
.width-guide-item.narrow .width-guide-color { background: #fef08a; }
.width-guide-item.medium .width-guide-color { background: #93c5fd; }
.width-guide-item.wide .width-guide-color { background: #86efac; }
.width-guide-text { display: flex; flex-direction: column; }
.width-guide-value {
	font-size: 14px;
	font-weight: 600;
	color: var(--text-primary);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* File upload */
.file-upload {
	border: 2px dashed var(--border);
	border-radius: var(--radius-md);
	padding: 32px;
	text-align: center;
	transition: var(--transition);
	cursor: pointer;
	background: var(--surface-elevated);
}
.file-upload:hover {
	border-color: var(--primary);
	background: var(--primary-bg);
}
.file-upload-icon { font-size: 40px; margin-bottom: 12px; }
.file-upload-text { font-size: 14px; color: var(--text-secondary); }
.file-upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.file-upload input[type="file"] { display: none; }

/* Return date highlight */
.return-date-highlight {
	background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
	border: 2px solid #f59e0b;
	border-radius: var(--radius-md);
	padding: 16px;
	position: relative;
}
.return-date-highlight::before {
	content: "重要";
	position: absolute;
	top: -10px;
	left: 12px;
	background: #f59e0b;
	color: white;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 4px;
}
.return-date-label { color: #92400e !important; font-weight: 600 !important; font-size: 14px !important; }
.return-date-icon { font-size: 18px; margin-right: 4px; }
.return-date-input {
	border-color: #f59e0b !important;
	background: white !important;
	font-weight: 600;
	font-size: 15px !important;
}
.return-date-input:focus { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3) !important; }
.return-date-hint { font-size: 12px; color: #b45309; margin-top: 8px; font-weight: 500; }

/* Site code (複数) UI */
.sitecode-list { display: grid; gap: 10px; }
.sitecode-row { display: grid; grid-template-columns: 1fr 40px; gap: 10px; align-items: center; }
.sitecode-btn-icon {
	width: 40px;
	height: 40px;
	border-radius: var(--radius-sm);
	border: 1.5px solid var(--border);
	background: var(--surface);
	cursor: pointer;
	transition: var(--transition);
}
.sitecode-btn-icon:hover { background: var(--surface-elevated); border-color: var(--text-muted); }
.sitecode-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.sitecode-bulk { margin-top: 10px; }
.customer-set-top-grid { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 20px; align-items: end; }
.customer-set-remove-group {
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

/* Site check */
.sitecheck-box {
	margin-top: 14px;
	padding: 16px;
	background: var(--surface-elevated);
	border: 1px dashed var(--border);
	border-radius: var(--radius-md);
}
.sitecheck-details { margin-top: 12px; }
.sitecheck-details.hidden { display: none; }

.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* Buttons */
.form-actions { display: flex; justify-content: center; gap: 16px; margin-top: 32px; }
.btn {
	padding: 14px 32px;
	border-radius: var(--radius-md);
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: var(--transition);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
}
.btn-primary {
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
	color: white;
	box-shadow: var(--shadow-md), 0 4px 14px rgba(26, 86, 219, 0.3);
}
.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg), 0 6px 20px rgba(26, 86, 219, 0.4);
}
.btn-secondary {
	background: var(--surface);
	color: var(--text-secondary);
	border: 2px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-elevated); border-color: var(--text-muted); }

.btn-danger {
	background: linear-gradient(135deg, var(--danger) 0%, #ef4444 100%);
	color: white;
	box-shadow: var(--shadow-md), 0 4px 14px rgba(220, 38, 38, 0.25);
}
.btn-danger:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg), 0 6px 20px rgba(220, 38, 38, 0.35);
}

/* Note / Error */
.note-box {
	background: var(--warning-bg);
	border-left: 4px solid var(--warning);
	padding: 12px 16px;
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	font-size: 13px;
	color: var(--text-secondary);
	margin-top: 16px;
}
.error_list {
	background: var(--danger-bg);
	border-left: 4px solid var(--danger);
	padding: 12px 16px;
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	font-size: 13px;
	color: var(--danger);
	margin: 12px 0 0;
	text-align: left;
}
.error_list li { margin-left: 18px; list-style: disc; }

/* Result */
.result-box {
	background: var(--primary-bg);
	border-left: 4px solid var(--primary);
	padding: 12px 16px;
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	font-size: 14px;
	color: var(--text-primary);
}
.result-box ul { margin-left: 18px; }
.result-box li { list-style: disc; }

/* Data Table */
.data-table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	background: var(--surface);
}
.data-table thead th {
	text-align: left;
	font-size: 12px;
	color: var(--text-secondary);
	background: var(--surface-elevated);
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
}
.data-table tbody td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
	font-size: 14px;
}
.data-table tbody tr:hover { background: rgba(59, 130, 246, 0.06); }
.data-table .txt-center { text-align: center; }
.data-table .muted { color: var(--text-secondary); }

/* Search list */
.result-pair { display: flex; flex-direction: column; gap: 4px; }
.pagination {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-end;
	margin: 12px 0;
}
.pagination a,
.pagination span,
.pagination button {
	padding: 6px 10px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	font-size: 12px;
	text-decoration: none;
	color: var(--text-secondary);
	background: var(--surface);
}
.pagination button {
	cursor: pointer;
	transition: var(--transition);
}
.pagination button:hover {
	background: var(--surface-elevated);
	border-color: var(--text-muted);
}
.pagination .active {
	background: var(--primary-bg);
	color: var(--primary);
	border-color: var(--primary);
	font-weight: 600;
}
.pagination .disabled {
	color: var(--text-muted);
	background: var(--surface-elevated);
}
.btn-mini {
	display: inline-block;
	padding: 8px 12px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text-secondary);
	text-decoration: none;
	font-size: 12px;
	box-shadow: var(--shadow-sm);
}
.btn-mini:hover { border-color: var(--text-muted); background: var(--surface-elevated); }

/* History view */
.history-actions {
	margin-bottom: 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}
.history-filter {
	display: flex;
	gap: 6px;
	align-items: center;
}
.history-add-btn {
	margin-left: auto;
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
	border-color: transparent;
	color: #fff;
}
.history-add-btn:hover {
	background: linear-gradient(135deg, #1849b3 0%, #2563eb 100%);
	border-color: transparent;
}

/* Delivery search */
.delivery-list-help {
	color: var(--text-secondary);
	font-size: 13px;
	margin-bottom: 12px;
}
.delivery-entry-help {
	color: var(--text-secondary);
	font-size: 13px;
	margin-bottom: 12px;
}
.delivery-entry-errors {
	color: #b42318;
	background: #fef3f2;
	border: 1px solid #fecdca;
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	margin-bottom: 12px;
	font-size: 13px;
}
.delivery-entry-errors ul {
	list-style: disc;
	padding-left: 18px;
}
.delivery-entry-table-wrap {
	overflow-x: auto;
}
.delivery-entry-table {
	width: 100%;
	min-width: 760px;
	border-collapse: collapse;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: var(--surface-elevated);
}
.delivery-entry-table th {
	text-align: left;
	font-size: 12px;
	color: var(--text-secondary);
	background: var(--surface);
	padding: 8px 12px;
	border-bottom: 1px solid var(--border);
}
.delivery-entry-row td {
	padding: 8px 12px;
	border-bottom: 1px solid var(--border);
}
.delivery-entry-row:last-child td {
	border-bottom: none;
}
.delivery-entry-no {
	text-align: center;
	font-weight: 700;
	color: var(--primary);
	font-size: 13px;
}
.delivery-entry-row .form-input {
	width: 100%;
}
.delivery-entry-field {
	display: flex;
	align-items: center;
	gap: 8px;
}
.delivery-entry-field .form-input {
	flex: 0 0 160px;
	width: 160px;
	min-width: 120px;
}
.delivery-entry-name {
	flex: 1 1 auto;
	min-width: 120px;
	font-size: 12px;
	color: var(--text-secondary);
	line-height: 1.4;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.delivery-entry-name.is-ok {
	color: var(--text-primary);
	font-weight: 600;
}
.delivery-entry-name.is-alert {
	color: #b42318;
}
.delivery-entry-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 12px;
}
.created-delivery-table th,
.created-delivery-table td {
	padding-top: 10px;
	padding-bottom: 10px;
}
.delivery-list-empty {
	color: var(--text-muted);
	background: var(--surface-elevated);
	border: 1px dashed var(--border);
	border-radius: var(--radius-sm);
	padding: 12px;
	margin-bottom: 12px;
}
.delivery-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 16px;
}
.delivery-item {
	display: grid;
	grid-template-columns: 60px 1fr 90px;
	gap: 12px;
	align-items: center;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
	cursor: grab;
}
.delivery-item.is-dragging {
	opacity: 0.6;
	cursor: grabbing;
}
.delivery-item.is-dragover {
	border-color: var(--primary);
	background: var(--primary-bg);
}
.delivery-order {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--primary-bg);
	color: var(--primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 16px;
}
.delivery-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.delivery-title {
	font-weight: 600;
	color: var(--text-primary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.delivery-title a {
	color: inherit;
	text-decoration: underline;
}
.delivery-title a:hover {
	color: var(--primary);
}
.delivery-sub {
	font-size: 12px;
	color: var(--text-secondary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.delivery-actions {
	text-align: right;
}
.delivery-list-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}
.page-delivery-search .autocomplete-wrap .js-delivery-site-candidates {
	position: static;
	margin-top: 6px;
	max-height: 320px;
	overflow: auto;
}

/* Map production */
.map-production-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	align-items: start;
}
.address-line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
.copy-field {
	display: flex;
	gap: 8px;
	align-items: center;
}
.copy-field input { flex: 1; }
.map-image-title {
	justify-content: space-between;
	align-items: center;
	gap: 10px;
}
.map-image-title-text {
	display: inline-block;
	font-size: 15px;
	font-weight: 700;
	color: var(--text-primary);
}
.map-preview-box {
	border: 1px dashed var(--border);
	border-radius: var(--radius-sm);
	padding: 10px;
	background: var(--surface-elevated);
	text-align: center;
	cursor: text;
	outline: none;
	transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.map-preview-box:focus,
.map-preview-box.is-paste-ready {
	border-color: var(--primary);
	background: var(--primary-bg);
	box-shadow: 0 0 0 3px var(--primary-ring);
}
.map-preview-box.has-image {
	background: var(--surface-elevated);
}
.map-preview-focus-hint {
	display: none;
	margin-top: 6px;
	font-size: 12px;
	font-weight: 600;
	color: var(--primary);
}
.map-preview-box:focus .map-preview-focus-hint,
.map-preview-box.is-paste-ready .map-preview-focus-hint {
	display: block;
}
.map-preview-status {
	margin-top: 6px;
	padding: 8px 10px;
	border-radius: var(--radius-sm);
	font-size: 12px;
	line-height: 1.5;
	color: var(--text-secondary);
	background: var(--surface-elevated);
	border: 1px solid var(--border);
}
.map-preview-status.focused {
	color: var(--primary);
	background: var(--primary-bg);
	border-color: var(--primary);
}
.map-preview-status.success {
	color: var(--secondary);
	background: var(--secondary-bg);
	border-color: var(--secondary);
}
.map-preview-image {
	width: 100%;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	cursor: pointer;
}
.page-request .map-preview-box .map-preview-image,
.page-map-production .map-preview-box .map-preview-image {
	cursor: default;
}
.map-preview-empty {
	font-size: 12px;
	color: var(--text-secondary);
	padding: 18px 0;
}
.map-preview-actions {
	margin-top: 8px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.section-actions {
	margin-top: 12px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.map-image-modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}
.map-image-modal.is-open { display: flex; }
.map-image-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
}
.map-image-modal-content {
	position: relative;
	background: var(--surface);
	border-radius: var(--radius-md);
	padding: 16px;
	box-shadow: var(--shadow-lg);
	max-width: 92vw;
	max-height: 92vh;
	z-index: 1;
}
.map-image-modal-content img {
	max-width: 88vw;
	max-height: 80vh;
	display: block;
}
.map-image-modal-close {
	position: absolute;
	top: 6px;
	right: 8px;
	border: none;
	background: transparent;
	font-size: 20px;
	cursor: pointer;
	color: var(--text-secondary);
}
@media (max-width: 900px) {
	.map-production-grid { grid-template-columns: 1fr; }
}

/* Role / Autocomplete */
.role-card {
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: var(--shadow-md);
	overflow: hidden;
}
.role-card-head {
	padding: 16px 20px;
	background: linear-gradient(to right, var(--surface-elevated), var(--surface));
	border-bottom: 1px solid var(--border);
}
.role-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.role-sub { font-size: 12px; margin-top: 4px; }
.autocomplete-items {
	position: relative;
	margin-top: 6px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-md);
	background: var(--surface);
	overflow: hidden;
	display: none;
}
.autocomplete-wrap { position: relative; }
.autocomplete-wrap .autocomplete-items {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	margin-top: 0;
	z-index: 50;
	max-height: 240px;
	overflow: auto;
}
.autocomplete-item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 10px 12px;
	border: none;
	background: transparent;
	cursor: pointer;
	font-size: 13px;
	color: var(--text-primary);
	border-bottom: 1px solid var(--border);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: rgba(59, 130, 246, 0.08); }

/* Small inputs (table add row) */
.form-input-sm {
	padding: 10px 12px;
	font-size: 13px;
	border-radius: var(--radius-sm);
}

/* Header action links (logout etc.) */
.header-actions {
	margin-top: 12px;
	display: flex;
	justify-content: center;
	gap: 12px;
	flex-wrap: wrap;
}
.header-actions a {
	font-size: 13px;
	color: var(--text-secondary);
	text-decoration: none;
	border: 1px solid var(--border);
	background: var(--surface);
	padding: 8px 12px;
	border-radius: 999px;
	box-shadow: var(--shadow-sm);
}
.header-actions a:hover {
	border-color: var(--text-muted);
	background: var(--surface-elevated);
}

/* 閲覧ページ: 右下固定のページ上部へ戻る */
.page-top-fab {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 42px;
	height: 42px;
	border: 1px solid #1565c0;
	border-radius: 999px;
	background: #1976d2;
	color: #ffffff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	box-shadow: var(--shadow-md);
	z-index: 1200;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: var(--transition);
}
.page-top-fab.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}
.page-top-fab:hover {
	background: #1565c0;
	border-color: #0d47a1;
}


/* Responsive */
@media (max-width: 768px) {
	.form-grid, .form-grid-2 { grid-template-columns: 1fr; }
	.customer-set-top-grid { grid-template-columns: 1fr; gap: 12px; }
	.customer-set-remove-group { justify-content: flex-end; }
	.span-2, .span-3 { grid-column: span 1; }
	.stepper { flex-wrap: wrap; }
	.step { flex: 1 1 50%; border-right: 1px solid var(--border); }
	.step:nth-child(2n) { border-right: none; }
	.data-table thead { display: none; }
	.data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
	.data-table tr { border-bottom: 1px solid var(--border); }
	.data-table td { border: none; }
	.created-delivery-table thead { display: table-header-group; }
	.created-delivery-table,
	.created-delivery-table tbody { display: table; width: 100%; }
	.created-delivery-table tr { display: table-row; border-bottom: none; }
	.created-delivery-table th,
	.created-delivery-table td { display: table-cell; border: none; }
	.created-delivery-table tbody td { border-bottom: 1px solid var(--border); }
	.page-top-fab {
		right: 12px;
		bottom: 12px;
	}
}

/* ------------------------------------------------------------
 * 閲覧（Read-only）表示
 * - 参照: /_reference/design/地図作成依頼書_情報閲覧.html
 * - body に `readonly-view` を付与した場合のみ適用
 * ------------------------------------------------------------ */
.readonly-view .required { display: none !important; }

.readonly-view .form-input.readonly-field,
.readonly-view .form-select.readonly-field,
.readonly-view .form-textarea.readonly-field {
	border: none !important;
	box-shadow: none !important;
	background: #f0fdfa !important; /* subtle confirmed tint */
	border-left: 4px solid #0f766e !important;
	color: var(--text-primary) !important;
	font-weight: 600 !important;
}

/* 閲覧の複数行項目は内容欠けを防ぐ */
.readonly-view .form-textarea.readonly-field {
	height: auto;
	max-height: 360px;
	overflow-y: auto;
	resize: vertical;
	pointer-events: auto;
}

/* disabled でも可読性を落とさない */
.readonly-view .form-input:disabled,
.readonly-view .form-select:disabled,
.readonly-view .form-textarea:disabled {
	opacity: 1 !important;
	color: var(--text-primary) !important;
}

/* クリック/入力を抑止（更新ボタン等は例外で許可） */
.readonly-view input,
.readonly-view textarea,
.readonly-view select {
	pointer-events: none;
}
.readonly-view .history-filter select {
	pointer-events: auto;
}
.readonly-view .btn,
.readonly-view a.btn,
.readonly-view #updateBtn {
	pointer-events: auto;
}

/* 閲覧では折りたたみ上限を解除し、長文を完全表示する */
.readonly-view .toggle-content.visible,
.readonly-view .conditional-section.visible {
	max-height: none;
	overflow: visible;
}

/* ファイルエリアを「添付済み」風に */
.readonly-view .file-upload {
	border-style: solid !important;
	background: #f1f5f9 !important;
	cursor: default !important;
}
.readonly-view .file-upload:hover {
	border-color: var(--border) !important;
	background: #f1f5f9 !important;
}

/* 車種選択の見た目は閲覧でも分かるように */
.readonly-view .vehicle-checkbox { cursor: default !important; }
.readonly-view .vehicle-checkbox:hover .vehicle-content { border-color: var(--border) !important; }
.readonly-view .vehicle-checkbox input:checked + .vehicle-content {
	border-color: #065f46 !important;
	background: #065f46 !important;
	color: #ffffff !important;
}

/* request/view: 得意先セット（2件目以降）アコーディオン */
.readonly-view .request-view-customer-set-toggle-wrap {
	margin-top: 10px;
	display: flex;
	justify-content: flex-end;
}
.readonly-view .request-view-customer-set-toggle-btn {
	min-width: 36px;
	padding: 6px 10px;
	font-size: 16px;
	line-height: 1;
	text-align: center;
}
.readonly-view .request-view-customer-set-accordion {
	margin-top: 8px;
}
.readonly-view .request-view-customer-set-item {
	margin-top: 8px;
}

/* ------------------------------------------------------------
 * 手書き編集（地図）
 * ------------------------------------------------------------ */
body.page-map-annotation .container {
	max-width: 1200px;
}

.annotation-workspace {
	display: grid;
	grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

.annotation-panel,
.annotation-canvas-shell {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	padding: 16px;
	box-shadow: var(--shadow-sm);
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.annotation-tool-group {
	display: grid;
	gap: 8px;
}

.annotation-tool-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--text-secondary);
}

.annotation-chip-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.annotation-chip {
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text-primary);
	font-size: 12px;
	font-weight: 600;
	padding: 8px 14px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	transition: var(--transition);
	user-select: none;
}

.annotation-chip:hover {
	border-color: var(--primary-light);
}

.annotation-chip.is-active {
	border-color: var(--primary);
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
	transform: translateY(-1px);
}

.annotation-color-swatch {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1px solid rgba(30, 41, 59, 0.2);
}

.annotation-action-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.annotation-btn {
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text-primary);
	font-size: 12px;
	font-weight: 600;
	padding: 8px 14px;
	cursor: pointer;
	transition: var(--transition);
}

.annotation-btn:hover,
.annotation-btn.is-active {
	border-color: var(--primary);
	color: var(--primary);
}

.annotation-canvas-wrapper {
	position: relative;
	border-radius: var(--radius-md);
	overflow: hidden;
	border: 1px solid var(--border);
	background: #0f172a;
	max-width: min(100%, 980px);
	margin: 0 auto;
}

.annotation-canvas-wrapper img {
	display: block;
	width: 100%;
	height: auto;
	pointer-events: none;
	user-select: none;
}

.annotation-canvas-wrapper canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	touch-action: none;
	cursor: crosshair;
}

#annotationStampCanvas {
	pointer-events: none;
	z-index: 1;
}

#annotationCanvas {
	z-index: 2;
}

#annotationCanvas.is-stamp-mode {
	cursor: move;
}

.annotation-stamp-chip {
	padding: 6px 10px;
}

.annotation-stamp-icon {
	width: 18px;
	height: 18px;
	object-fit: contain;
}

.annotation-status {
	font-size: 12px;
	color: var(--text-secondary);
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: space-between;
	align-items: center;
}

.annotation-status-hint {
	color: var(--text-muted);
}

@media (max-width: 980px) {
	.annotation-workspace {
		grid-template-columns: 1fr;
	}
}