.action-button {
	height: 34px;
	border-radius: 7px;
	border: 1px solid #c7cedf;
	background: #ffffff;
	color: #111827;
	font-weight: 700;
	padding: 0 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
}

.action-button.primary {
	background: var(--primary);
	color: #ffffff;
	border-color: #3735c4;
}

.action-button.danger,
.entry-button.danger {
	border-color: #f1b8b0;
	color: #b42318;
}

.roadview-button {
	border-color: #80c7b7;
	background: #e8f7f3;
	color: #116657;
}

.roadview-button:hover {
	background: #d8f1ea;
}

.roadview-button.is-active {
	border-color: #f2aaa3;
	background: #fff1f0;
	color: #b42318;
}

.roadview-button.is-active:hover {
	background: #ffe4e1;
}

.action-button:disabled {
	cursor: not-allowed;
	opacity: .55;
}

.inventory-map-workspace {
	padding: 10px 14px 20px;
}

.inventory-map-workspace .page-head,
.inventory-map-workspace .tool-surface {
	width: 100%;
	max-width: none !important;
	margin-left: 0;
	margin-right: 0;
}

.inventory-map-workspace .page-head {
	margin-bottom: 12px;
}

.map-stage,
.inventory-panel {
	border: 1px solid var(--line);
	border-radius: 8px;
	background: #ffffff;
	box-shadow: var(--shadow);
	overflow: hidden;
}

.map-stage {
	margin-bottom: 12px;
}

.map-toolbar {
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 10px;
	border-bottom: 1px solid #e3e8f2;
	background: #fbfcff;
}

.map-status,
.meta {
	min-width: 0;
	color: #617086;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.35;
}

.map-status.is-error {
	color: #b42318;
}

.map-tools,
.saved-actions,
.form-actions,
.entry-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.inventory-map-canvas {
	width: 100%;
	height: clamp(360px, 48vh, 620px);
	background: #eef3f8;
}

.inventory-roadview-panel {
	border-top: 1px solid #e3e8f2;
	background: #fbfcff;
}

.inventory-roadview-panel[hidden] {
	display: none;
}

.roadview-head {
	min-height: 42px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 12px;
	border-bottom: 1px solid #e3e8f2;
}

.roadview-head h2 {
	margin: 0;
	color: #1d2b42;
	font-size: 14px;
	font-weight: 850;
	line-height: 1.2;
}

.roadview-head span {
	color: #617086;
	font-size: 12px;
	font-weight: 800;
	text-align: right;
}

.inventory-roadview-canvas {
	width: 100%;
	height: 360px;
	background: #eef3f8;
}

.storage-warning {
	margin-bottom: 12px !important;
}

.inventory-grid {
	display: grid;
	grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr);
	gap: 12px;
	align-items: stretch;
	margin-bottom: 12px;
}

.inventory-panel {
	margin-bottom: 12px;
}

.inventory-grid > .inventory-panel {
	height: 100%;
	margin-bottom: 0;
}

.panel-head {
	min-height: 46px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 12px;
	border-bottom: 1px solid #e3e8f2;
}

.panel-head h2 {
	margin: 0;
	color: #1d2b42;
	font-size: 15px;
	font-weight: 850;
	line-height: 1.2;
}

.inventory-message {
	margin: 12px;
	border: 1px solid #d7dcea;
	border-radius: 7px;
	background: #f8fafc;
	color: #344054;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.45;
}

.inventory-message[hidden] {
	display: none;
}

.inventory-message.is-error {
	border-color: #f4b7b0;
	background: #fff5f4;
	color: #b42318;
}

.inventory-toast {
	position: fixed;
	top: 76px;
	right: 22px;
	z-index: 100;
	width: min(380px, calc(100vw - 28px));
	border: 1px solid #ccd4e5;
	border-left: 4px solid var(--primary);
	border-radius: 8px;
	background: #ffffff;
	box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
	color: #1d2b42;
	font-size: 13px;
	font-weight: 750;
	line-height: 1.45;
	padding: 12px 14px;
	opacity: 0;
	transform: translateY(10px);
	pointer-events: none;
	transition: opacity .16s ease, transform .16s ease;
}

.inventory-toast[hidden] {
	display: none;
}

.inventory-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.inventory-toast.is-error {
	border-left-color: #d92d20;
	color: #b42318;
}

.location-details {
	display: grid;
	border-top: 1px solid #edf1f7;
}

.location-details[hidden] {
	display: none;
}

.location-details div {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: 12px;
	padding: 10px 12px;
	border-top: 1px solid #edf1f7;
}

.location-details div:first-child {
	border-top: 0;
}

.location-details span,
.inventory-form label > span,
.exchange-box label > span {
	color: #617086;
	font-size: 12px;
	font-weight: 850;
	line-height: 1.25;
}

.location-details strong {
	min-width: 0;
	color: #102033;
	font-size: 13px;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.location-details div:nth-child(-n+2) strong {
	font-family: var(--font-mono);
}

.inventory-form,
.exchange-box {
	display: grid;
	gap: 12px;
	padding: 12px;
}

.inventory-form label,
.exchange-box label {
	display: grid;
	gap: 7px;
	min-width: 0;
}

.inventory-form input,
.inventory-form select,
.inventory-form textarea,
.exchange-box input {
	width: 100%;
	border: 1px solid #cfd7e6;
	border-radius: 7px;
	background: #ffffff;
	color: #102033;
	outline: 0;
}

.inventory-form input,
.inventory-form select,
.exchange-box input {
	height: 40px;
	padding: 0 10px;
}

.inventory-form textarea {
	min-height: 82px;
	padding: 10px;
	resize: vertical;
}

.inventory-form input:focus,
.inventory-form select:focus,
.inventory-form textarea:focus,
.exchange-box input:focus {
	border-color: #7779ee;
	box-shadow: 0 0 0 3px rgba(74, 75, 224, .14);
}

.category-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}

.product-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 140px 110px;
	gap: 10px;
}

.saved-panel {
	overflow: visible;
}

.inventory-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 10px;
	padding: 12px;
}

.empty-list {
	margin: 0;
	grid-column: 1 / -1;
	border: 1px dashed #cbd4e5;
	border-radius: 8px;
	background: #fbfcff;
	color: #617086;
	padding: 18px;
	text-align: center;
	font-weight: 750;
}

.inventory-entry {
	border: 1px solid #dbe2ed;
	border-radius: 8px;
	background: #ffffff;
	padding: 12px;
	display: grid;
	gap: 8px;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.inventory-entry.active {
	border-color: #6063ea;
	box-shadow: 0 0 0 3px rgba(74, 75, 224, .12);
}

.entry-title {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.entry-title strong {
	min-width: 0;
	color: #102033;
	font-size: 15px;
	font-weight: 850;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.entry-title span {
	flex: 0 0 auto;
	border-radius: 999px;
	background: #e9f8ef;
	color: #217a3a;
	font-size: 12px;
	font-weight: 850;
	padding: 4px 8px;
}

.entry-category,
.entry-address,
.entry-meta,
.entry-note {
	margin: 0;
	color: #40506a;
	font-size: 13px;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.entry-category {
	color: #364fc7;
	font-weight: 800;
}

.entry-meta {
	color: #718096;
	font-family: var(--font-mono);
	font-size: 12px;
}

.entry-note {
	border-top: 1px solid #edf1f7;
	padding-top: 8px;
}

.entry-button {
	min-height: 30px;
	border: 1px solid #c7cedf;
	border-radius: 7px;
	background: #ffffff;
	color: #22324a;
	font-size: 12px;
	font-weight: 850;
	text-decoration: none;
	padding: 6px 9px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.entry-button:hover {
	background: #f0f4fb;
}

.exchange-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	padding: 12px;
}

.exchange-box {
	border: 1px solid #dbe2ed;
	border-radius: 8px;
	background: #fbfcff;
}

.exchange-panel.is-attention {
	animation: exchange-attention 1s ease-in-out 3;
}

@keyframes exchange-attention {
	0%,
	100% {
		box-shadow: var(--shadow);
		border-color: var(--line);
	}

	50% {
		box-shadow: 0 0 0 4px rgba(74, 75, 224, .18), var(--shadow);
		border-color: #7779ee;
	}
}

.exchange-box h3 {
	margin: 0;
	color: #1d2b42;
	font-size: 14px;
	font-weight: 850;
}

.download-fallback {
	display: inline-flex;
	align-items: center;
	width: fit-content;
	max-width: calc(100% - 24px);
	margin: 0 12px 12px;
	border: 1px solid #b8c4f5;
	border-radius: 7px;
	background: #eef0ff;
	color: #342ec7;
	font-size: 13px;
	font-weight: 850;
	line-height: 1.35;
	text-decoration: none;
	padding: 9px 11px;
}

.download-fallback:hover {
	background: #e3e7ff;
}

.inventory-info-window {
	position: relative;
	display: grid;
	gap: 10px;
	width: 268px;
	max-width: 70vw;
	padding: 14px;
	border: 0;
	border-radius: 10px;
	background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
	box-shadow: 0 18px 42px rgba(15, 23, 42, .2), inset 0 1px 0 rgba(255, 255, 255, .9);
	color: #102033;
	font-family: var(--font-sans);
}

.inventory-info-window::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -8px;
	width: 16px;
	height: 16px;
	background: #fbfcff;
	box-shadow: 4px 4px 10px rgba(15, 23, 42, .08);
	transform: translateX(-50%) rotate(45deg);
}

.info-window-close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 1;
	width: 26px;
	height: 26px;
	border: 1px solid #dbe2ed;
	border-radius: 50%;
	background: #ffffff;
	color: #64748b;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.info-window-close:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.info-window-close svg {
	width: 14px;
	height: 14px;
	display: block;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.info-window-top {
	display: grid;
	gap: 6px;
	padding-right: 28px;
}

.info-window-badge {
	width: fit-content;
	border-radius: 999px;
	background: #eef0ff;
	color: #342ec7;
	font-size: 11px;
	font-weight: 900;
	line-height: 1;
	padding: 5px 8px;
}

.info-window-top strong {
	color: #102033;
	font-size: 15px;
	font-weight: 900;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.info-window-quantity {
	display: inline-flex;
	align-items: baseline;
	gap: 5px;
	width: fit-content;
	border-radius: 8px;
	background: linear-gradient(135deg, #e9f8ef 0%, #def7e8 100%);
	color: #217a3a;
	padding: 8px 10px;
}

.info-window-quantity span {
	font-size: 18px;
	font-weight: 950;
	line-height: 1;
}

.info-window-quantity small {
	font-size: 12px;
	font-weight: 850;
}

.info-window-category,
.info-window-address,
.info-window-note {
	border-top: 1px solid #edf1f7;
	padding-top: 8px;
	color: #40506a;
	font-size: 12px;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.info-window-category {
	color: #364fc7;
	font-weight: 850;
}

.info-window-note {
	border-radius: 7px;
	border-top: 0;
	background: #f6f8fb;
	color: #334155;
	padding: 8px;
}

@media (max-width: 980px) {
	.inventory-grid,
	.exchange-grid {
		grid-template-columns: 1fr;
	}

	.category-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.inventory-map-workspace {
		padding: 20px 14px;
	}

	.inventory-map-workspace .page-actions,
	.map-toolbar,
	.product-row,
	.category-grid,
	.location-details div {
		grid-template-columns: 1fr;
		display: grid;
	}

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

	.map-tools,
	.saved-actions,
	.form-actions,
	.entry-actions {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		width: 100%;
	}

	.action-button,
	.entry-button {
		width: 100%;
	}

	.inventory-map-canvas {
		height: 380px;
	}

	.inventory-list {
		grid-template-columns: 1fr;
	}

	.inventory-toast {
		top: 70px;
		right: auto;
		left: 50%;
		transform: translate(-50%, 10px);
	}

	.inventory-toast.is-visible {
		transform: translate(-50%, 0);
	}
}
