:root {
	color-scheme: dark;
}
body {
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
.card, .panel {
	background: rgba(15, 23, 42, 0.85);
	border: 1px solid rgba(51, 65, 85, 0.9);
	border-radius: 1rem;
	padding: 1rem;
}
.label {
	font-size: 0.8rem;
	color: #94a3b8;
	margin-bottom: 0.35rem;
}
.value {
	font-size: 1.6rem;
	font-weight: 700;
}
.value-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 2rem;
	width: 2rem;
	height: 2rem;
	border-radius: 0.5rem;
	color: #94a3b8;
}
.value-toggle:hover, .value-toggle:focus-visible {
	background: rgba(51, 65, 85, 0.6);
	color: #e2e8f0;
	outline: none;
}
.panel-title {
	font-size: 1rem;
	font-weight: 700;
}
.nav-pill, .action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.65rem 0.9rem;
	border-radius: 9999px;
	background: #0f172a;
	border: 1px solid #334155;
	color: #e2e8f0;
}
.action-btn {
	background: linear-gradient(180deg, #155e75, #0f172a);
}
.input {
	width: 100%;
	background: #020617;
	border: 1px solid #334155;
	border-radius: 0.8rem;
	padding: 0.8rem 0.9rem;
}
.data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}
.data-table th, .data-table td {
	padding: 0.7rem;
	border-bottom: 1px solid rgba(51, 65, 85, 0.8);
	text-align: left;
	vertical-align: top;
}
.legend {
	display: inline-block;
	width: 0.8rem;
	height: 0.8rem;
	border-radius: 999px;
	margin-right: 0.35rem;
}
.legend.gun, .node-circle.gun { fill: #22c55e; background: #22c55e; }
.legend.accessory, .node-circle.accessory { fill: #38bdf8; background: #38bdf8; }
.legend.ammo, .node-circle.ammo { fill: #f59e0b; background: #f59e0b; }
.graph-link.mount { stroke: #94a3b8; stroke-width: 2.2; }
.graph-link.caliber { stroke: rgba(245, 158, 11, 0.55); stroke-dasharray: 4 4; stroke-width: 1.6; }
.graph-link.temp { stroke: #f8fafc; stroke-width: 2; }
.hidden { display: none; }
svg { touch-action: none; }
.upload-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.2rem;
	height: 2.2rem;
	border-radius: 0.6rem;
	border: 1px solid #334155;
	background: #0f172a;
	cursor: pointer;
	font-size: 1rem;
	transition: background 0.15s;
}
.upload-btn:hover {
	background: #1e293b;
}
/* Drop zone */
.drop-zone {
	border: 2px dashed #334155;
	border-radius: 0.75rem;
	padding: 1.5rem 1rem;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone-active {
	border-color: #38bdf8;
	background: rgba(56, 189, 248, 0.06);
}
.drop-zone-text {
	color: #94a3b8;
	font-size: 0.85rem;
}
.data-table td img {
	cursor: zoom-in;
}
.data-table td {
	overflow: visible !important;
}
.img-zoom-overlay {
	position: fixed;
	z-index: 9999;
	pointer-events: none;
	border-radius: 0.5rem;
	box-shadow: 0 8px 32px rgba(0,0,0,0.8);
	max-width: 50vw;
	max-height: 50vh;
	object-fit: contain;
	background: #0f172a;
}
.mount-dropdown div:hover {
	background: rgba(51, 65, 85, 0.6);
}
.photo-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	padding: 0.2rem 0.5rem;
	border-radius: 0.5rem;
	background: rgba(51, 65, 85, 0.6);
	font-size: 0.8rem;
	cursor: pointer;
	white-space: nowrap;
	user-select: none;
}
.photo-badge:hover {
	background: rgba(56, 189, 248, 0.2);
}
/* Thumbnail images in inventory cells */
.img-cell {
	display: flex;
	gap: 0.25rem;
	flex-wrap: wrap;
	align-items: center;
	cursor: pointer;
}
.img-cell .thumb {
	width: 3rem;
	height: 2.5rem;
	border-radius: 0.4rem;
	object-fit: contain;
}
.img-cell .img-count {
	display: block;
	font-size: 0.7rem;
	color: #94a3b8;
	margin-top: 0.15rem;
	white-space: nowrap;
}
.lightbox-overlay {
	position: fixed;
	inset: 0;
	z-index: 10000;
	background: rgba(0,0,0,0.88);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
}
.lightbox-img {
	max-width: 90vw;
	max-height: 80vh;
	object-fit: contain;
	border-radius: 0.75rem;
}
.lightbox-nav {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	color: #e2e8f0;
	font-size: 1rem;
}
.lightbox-arrow {
	cursor: pointer;
	padding: 0.5rem;
	font-size: 1.5rem;
	user-select: none;
}
@media (max-width: 640px) {
	.value { font-size: 1.25rem; }
}

/* ── Mobile Navigation ── */
.mobile-menu-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 0.6rem;
	border: 1px solid #334155;
	background: #0f172a;
	color: #e2e8f0;
	cursor: pointer;
}
.mobile-nav {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease, opacity 0.2s ease;
	opacity: 0;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding-top: 0;
}
.mobile-nav.open {
	max-height: 32rem;
	opacity: 1;
	padding-top: 0.75rem;
}
.mobile-nav-link {
	display: block;
	padding: 0.7rem 0.75rem;
	border-radius: 0.75rem;
	color: #e2e8f0;
	font-size: 0.95rem;
	text-decoration: none;
	transition: background 0.15s;
}
.mobile-nav-link:hover, .mobile-nav-link:active {
	background: rgba(51, 65, 85, 0.5);
}

/* ── Card Grid (Mobile Inventory) ── */
.card-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.6rem;
}
.inv-card {
	background: rgba(15, 23, 42, 0.9);
	border: 1px solid rgba(51, 65, 85, 0.8);
	border-radius: 0.75rem;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	cursor: pointer;
	transition: border-color 0.15s;
}
.inv-card:active {
	border-color: #38bdf8;
}
.inv-card-img {
	width: 100%;
	aspect-ratio: 4 / 3;
	background-size: cover;
	background-position: center;
	background-color: #1e293b;
	position: relative;
}
.inv-card-noimg {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2rem;
	opacity: 0.25;
}
.inv-card-badge {
	position: absolute;
	bottom: 0.35rem;
	left: 0.35rem;
	background: rgba(0,0,0,0.7);
	color: #e2e8f0;
	font-size: 0.65rem;
	padding: 0.15rem 0.4rem;
	border-radius: 0.4rem;
}
.inv-card-body {
	padding: 0.5rem 0.6rem 0.35rem;
	flex: 1;
	min-height: 0;
}
.inv-card-title {
	font-weight: 600;
	font-size: 0.85rem;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.inv-card-sub {
	font-size: 0.75rem;
	color: #94a3b8;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.inv-card-meta {
	font-size: 0.7rem;
	color: #64748b;
	margin-top: 0.15rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.inv-card-actions {
	display: flex;
	gap: 0.35rem;
	padding: 0.35rem 0.5rem 0.5rem;
	justify-content: flex-end;
}
.inv-card-action {
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	border: 1px solid #334155;
	background: #0f172a;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
	cursor: pointer;
}
.inv-card-action:active {
	background: #1e293b;
}

/* ── Floating Action Button (Mobile) ── */
.fab {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	z-index: 30;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	background: linear-gradient(135deg, #0ea5e9, #0284c7);
	border: none;
	color: white;
	font-size: 1.5rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
	cursor: pointer;
}
.fab:active {
	transform: scale(0.92);
}

/* ── Shooting Log Cards (Mobile) ── */
.log-card {
	background: rgba(15, 23, 42, 0.9);
	border: 1px solid rgba(51, 65, 85, 0.8);
	border-radius: 0.75rem;
	padding: 0.75rem 0.85rem;
}
.log-card-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.35rem;
}
.log-card-gun {
	font-weight: 600;
	font-size: 0.9rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1;
	min-width: 0;
}
.log-card-date {
	font-size: 0.75rem;
	color: #64748b;
	margin-left: 0.5rem;
	white-space: nowrap;
}
.log-card-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	font-size: 0.8rem;
	color: #94a3b8;
}
.log-card-remarks {
	font-size: 0.75rem;
	color: #64748b;
	margin-top: 0.25rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.log-card-actions {
	display: flex;
	gap: 0.35rem;
	justify-content: flex-end;
	margin-top: 0.4rem;
}
