:root {
	--np-brand: #ea553a;
	--np-brand-dark: #c9452a;
	--np-brand-soft: #fef0ec;
	--np-brand-500: var(--np-brand);
	--np-brand-700: var(--np-brand-dark);
	--np-brand-900: #1a1d26;
	--np-brand-100: #f1f3f5;
	--np-green-900: var(--np-brand-900);
	--np-green-700: var(--np-brand-dark);
	--np-green-500: var(--np-brand);
	--np-green-100: var(--np-brand-100);
	--np-bg: #f4f5f7;
	--np-surface: #ffffff;
	--np-text: #1a1d26;
	--np-muted: #64748b;
	--np-border: #e8eaed;
	--np-accent: var(--np-brand);
	--np-radius: 16px;
	--np-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
	--np-safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
	:root {
		--np-bg: #12141a;
		--np-surface: #1c1f28;
		--np-text: #eef0f4;
		--np-muted: #94a3b8;
		--np-border: #2a2f3a;
		--np-brand-100: #2a2f3a;
		--np-brand-soft: #2d1f1a;
		--np-shadow: 0 4px 20px rgba(0,0,0,0.35);
	}
	.np-bottom-bar { background: rgba(28,31,40,0.94); }
}

*, *::before, *::after { box-sizing: border-box; }

body.nautilus-pack-app {
	margin: 0;
	font-family: Tahoma, 'Segoe UI', system-ui, Arial, sans-serif;
	background: var(--np-bg);
	color: var(--np-text);
	min-height: 100dvh;
	-webkit-font-smoothing: antialiased;
}

.np-root { min-height: 100dvh; display: flex; flex-direction: column; }

.np-loading {
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	min-height: 60vh; gap: 16px; color: var(--np-muted);
}
.np-spinner {
	width: 40px; height: 40px; border: 3px solid var(--np-green-100);
	border-top-color: var(--np-green-700); border-radius: 50%;
	animation: np-spin 0.8s linear infinite;
}
@keyframes np-spin { to { transform: rotate(360deg); } }

.np-header {
	background: var(--np-brand-900);
	color: #fff; padding: 24px 20px 32px; border-radius: 0 0 24px 24px;
	position: relative; overflow: hidden;
	border-bottom: 3px solid var(--np-brand);
}
.np-header::after {
	content: ''; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 60%);
	pointer-events: none;
}
.np-header-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.np-logo { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.np-logo-icon { font-size: 1.8rem; }
.np-subtitle { opacity: 0.85; font-size: 0.9rem; margin: 0; }

.np-main { flex: 1; max-width: 640px; width: 100%; margin: -24px auto 0; padding: 0 16px calc(88px + var(--np-safe-bottom)); position: relative; z-index: 2; }

.np-card {
	background: var(--np-surface); border-radius: var(--np-radius);
	box-shadow: var(--np-shadow); padding: 18px; margin-bottom: 12px;
	border: 1px solid var(--np-border);
}
.np-card--compact { padding: 16px 18px; }
.np-card-title, .np-section-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 14px; color: var(--np-text); }

.np-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.np-action-btn {
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 8px; padding: 24px 16px; border: none; border-radius: var(--np-radius);
	background: var(--np-surface); box-shadow: var(--np-shadow); cursor: pointer;
	font-family: inherit; font-size: 0.95rem; font-weight: 600; color: var(--np-text);
	transition: transform 0.15s, box-shadow 0.15s; min-height: 120px;
}
.np-action-btn:active { transform: scale(0.97); }
.np-action-btn--primary { background: var(--np-brand); color: #fff; box-shadow: 0 4px 14px rgba(234,85,58,0.25); }
.np-action-icon { font-size: 2rem; }

.np-template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.np-template-card {
	padding: 14px; border: 1px solid var(--np-border); border-radius: 12px;
	cursor: pointer; transition: border-color 0.15s, background 0.15s; background: var(--np-surface);
	font-family: inherit; text-align: right; color: var(--np-text);
}
.np-template-card:hover, .np-template-card.is-selected {
	border-color: var(--np-brand); background: var(--np-brand-soft);
}
.np-template-card strong { display: block; font-size: 0.85rem; margin-bottom: 4px; }
.np-template-card small { color: var(--np-muted); font-size: 0.75rem; }

.np-form-group { margin-bottom: 14px; }
.np-label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; color: var(--np-muted); }
.np-input {
	width: 100%; padding: 12px 14px; border: 1px solid var(--np-border);
	border-radius: 10px; font-family: inherit; font-size: 1rem;
	background: var(--np-surface); color: var(--np-text);
}
.np-input:focus { outline: none; border-color: var(--np-brand); box-shadow: 0 0 0 3px var(--np-brand-soft); }

.np-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 12px 20px; border: none; border-radius: 10px; font-family: inherit;
	font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: opacity 0.15s;
}
.np-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.np-btn--primary { background: var(--np-brand); color: #fff; width: 100%; box-shadow: none; }
.np-btn--primary:hover { background: var(--np-brand-dark); }
.np-btn--ghost { background: transparent; color: var(--np-text); border: 1px solid var(--np-border); }
.np-btn--sm { padding: 8px 12px; font-size: 0.8rem; }

.np-trip-header { margin-bottom: 16px; }
.np-trip-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 6px; }
.np-trip-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.85rem; color: var(--np-muted); }

.np-progress-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.np-progress-ring { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.np-progress-ring svg { transform: rotate(-90deg); }
.np-progress-ring-text {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	font-size: 0.85rem; font-weight: 700; color: var(--np-green-700);
}
.np-progress-label { font-size: 0.9rem; color: var(--np-muted); }
.np-progress-label strong { display: block; font-size: 1.1rem; color: var(--np-text); }

.np-members { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.np-member-chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
	border-radius: 8px; font-size: 0.78rem; font-weight: 500;
	background: var(--np-brand-100); color: var(--np-text);
}
.np-member-dot { width: 10px; height: 10px; border-radius: 50%; }

.np-category { margin-bottom: 8px; }
.np-category-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 10px 4px; background: transparent; border-radius: 0;
	cursor: pointer; font-weight: 700; font-size: 0.82rem; border: none;
	width: 100%; font-family: inherit; color: var(--np-muted); text-align: right;
	text-transform: none; letter-spacing: 0;
	border-bottom: 1px solid rgba(0,0,0,0.06);
}
.np-category-body { padding: 4px 0 8px; }
.np-category-body.is-collapsed { display: none; }

.np-list-card { padding: 12px 14px 6px; }
.np-list-body { margin-top: 4px; }

.np-item {
	display: flex; align-items: center; gap: 12px; padding: 12px 8px;
	border-bottom: 1px solid rgba(0,0,0,0.05);
	transition: background 0.15s;
}
.np-item:active { background: var(--np-brand-100); }
.np-item:last-child { border-bottom: none; }
.np-item.is-packed { opacity: 0.5; }
.np-item.is-packed .np-item-name { text-decoration: line-through; color: var(--np-muted); }

.np-check {
	width: 24px; height: 24px; border: 2px solid var(--np-border); border-radius: 50%;
	flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
	background: var(--np-surface); transition: all 0.2s ease;
}
.np-check.is-checked { background: var(--np-brand); border-color: var(--np-brand); color: #fff; }
.np-check svg { width: 14px; height: 14px; }

.np-item-body { flex: 1; min-width: 0; cursor: pointer; }
.np-item-name { font-weight: 600; font-size: 0.92rem; margin-bottom: 5px; line-height: 1.35; }
.np-item-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.np-badge {
	font-size: 0.68rem; padding: 3px 8px; border-radius: 6px;
	background: var(--np-brand-100); color: var(--np-muted); font-weight: 500;
}
.np-badge[style*="--badge-color"] {
	background: color-mix(in srgb, var(--badge-color) 12%, transparent);
	color: var(--badge-color);
}
.np-badge--qty { background: var(--np-brand-100); color: var(--np-muted); }
.np-badge--note { background: var(--np-brand-soft); color: var(--np-brand); }

/* Inline shop in list */
.np-item-shop { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--np-border); }
.np-item-shop-label { display: block; font-size: 0.7rem; color: var(--np-muted); margin-bottom: 8px; }
.np-item-shop-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.np-item-shop-row::-webkit-scrollbar { display: none; }
.np-inline-product {
	flex: 0 0 148px; display: flex; align-items: center; gap: 8px;
	padding: 8px; background: var(--np-bg); border: 1px solid var(--np-border);
	border-radius: 10px; text-decoration: none; color: inherit; transition: border-color 0.15s;
}
.np-inline-product:active { border-color: var(--np-brand); }
.np-inline-product img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.np-inline-product-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.np-inline-product-name {
	font-size: 0.72rem; font-weight: 600; line-height: 1.3;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.np-inline-product-price { font-size: 0.7rem; font-weight: 700; color: var(--np-brand); }
.np-bottom-bar {
	position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
	background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
	border-top: 1px solid rgba(0,0,0,0.06);
	padding: 6px 8px calc(6px + var(--np-safe-bottom));
	display: flex; gap: 4px; justify-content: space-around; max-width: 640px; margin: 0 auto;
	box-shadow: 0 -8px 32px rgba(0,0,0,0.06);
}
.np-nav-btn {
	flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
	padding: 8px 4px; border: none; background: transparent; font-family: inherit;
	font-size: 0.65rem; font-weight: 600; color: var(--np-muted); cursor: pointer;
	border-radius: 12px; position: relative; transition: color 0.15s, background 0.15s;
	min-height: 52px;
}
.np-nav-btn.is-active { color: var(--np-brand); background: var(--np-brand-soft); }
.np-nav-icon { font-size: 1.15rem; line-height: 1; }
.np-nav-badge {
	position: absolute; top: 4px; left: 50%; margin-left: 10px;
	background: var(--np-brand); color: #fff; font-size: 0.6rem;
	min-width: 16px; height: 16px; border-radius: 999px; display: flex;
	align-items: center; justify-content: center; padding: 0 4px;
}
.np-fab {
	position: fixed; bottom: calc(80px + var(--np-safe-bottom)); left: 20px;
	width: 54px; height: 54px; border-radius: 50%; border: none;
	background: var(--np-brand); color: #fff; font-size: 1.5rem;
	box-shadow: 0 4px 16px rgba(234,85,58,0.35); cursor: pointer; z-index: 99;
	display: flex; align-items: center; justify-content: center;
	transition: transform 0.2s;
}
.np-fab:active { transform: scale(0.92); }

.np-modal-overlay {
	position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200;
	display: flex; align-items: flex-end; justify-content: center;
}
.np-modal {
	background: var(--np-surface); border-radius: 20px 20px 0 0; width: 100%;
	max-width: 640px; max-height: 85vh; overflow-y: auto; padding: 24px 20px;
}
.np-modal-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 16px; }

.np-recent-list { display: flex; flex-direction: column; gap: 8px; }
.np-recent-item {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 14px; background: var(--np-bg); border-radius: 10px;
	text-decoration: none; color: inherit; cursor: pointer;
}
.np-recent-item:hover { background: var(--np-brand-100); }

.np-pwa-banner {
	position: fixed; bottom: calc(70px + var(--np-safe-bottom)); left: 16px; right: 16px;
	max-width: 608px; margin: 0 auto; z-index: 98;
	background: var(--np-brand-900); color: #fff; padding: 12px 16px; border-radius: 12px;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	font-size: 0.85rem; box-shadow: var(--np-shadow);
}
.np-pwa-banner.is-hidden { display: none; }

.np-offline-badge {
	position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 150;
	background: var(--np-accent); color: #fff; padding: 6px 14px; border-radius: 999px;
	font-size: 0.75rem; display: none;
}
.np-offline-badge.is-visible { display: block; }

.np-toast {
	position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px);
	background: var(--np-brand-900); color: #fff; padding: 10px 20px; border-radius: 999px;
	font-size: 0.85rem; z-index: 300; transition: transform 0.3s;
}
.np-toast.is-visible { transform: translateX(-50%) translateY(0); }

.np-shop-section { margin-top: 20px; }
.np-shop-section h3 { font-size: 0.95rem; margin: 0 0 10px; }

@media print {
	.np-bottom-bar, .np-fab, .np-pwa-banner, .np-shop-link, .np-shop-products, .np-shop-section { display: none !important; }
	.np-header { background: #fff !important; color: #000 !important; }
	body { background: #fff; }
}

@media (min-width: 641px) {
	.np-modal-overlay { align-items: center; }
	.np-modal { border-radius: var(--np-radius); max-height: 70vh; }
}

/* ── v1.1 PackParty parity UI ── */
.np-header--hero { padding-bottom: 40px; }
.np-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.np-icon-btn { background: rgba(255,255,255,0.15); border: none; border-radius: 10px; width: 40px; height: 40px; cursor: pointer; font-size: 1.1rem; }
.np-header--mountain,
.np-header--forest,
.np-header--beach,
.np-header--festival,
.np-header--family,
.np-header--daytrip,
.np-header--winter,
.np-header--caravan,
.np-header--camping { background: var(--np-brand-900); }

.np-actions--hero { grid-template-columns: 1fr; }
.np-action-btn--lg { min-height: 140px; font-size: 1.05rem; }
.np-onboarding { display: grid; gap: 10px; margin-bottom: 20px; }
.np-onboarding-step { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--np-surface); border-radius: 12px; box-shadow: var(--np-shadow); }
.np-onboarding-step span { width: 28px; height: 28px; border-radius: 50%; background: var(--np-green-700); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.np-onboarding-step p { margin: 0; font-size: 0.85rem; }
.np-template-icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.np-recent-arrow { opacity: 0.5; }

.np-filter-bar {
	display: flex; gap: 6px; overflow-x: auto; padding: 0 0 10px;
	-webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.np-filter-bar::-webkit-scrollbar { display: none; }
.np-filter-tab {
	flex: 0 0 auto; padding: 7px 14px; border: none; border-radius: 999px;
	background: rgba(0,0,0,0.04); font-family: inherit; font-size: 0.78rem;
	font-weight: 600; cursor: pointer; color: var(--np-muted);
}
.np-filter-tab.is-active { background: var(--np-brand); color: #fff; }

.np-item-packer { font-size: 0.72rem; color: var(--np-brand-700); margin-top: 4px; }
.np-item.is-dragging { opacity: 0.5; }

/* Shop */
.np-shop-page { padding-bottom: 24px; }
.np-product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.np-product-card {
	display: flex; flex-direction: column; background: var(--np-bg);
	border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit;
	border: 1px solid rgba(0,0,0,0.05); transition: transform 0.15s;
}
.np-product-card:active { transform: scale(0.98); }
.np-product-img { aspect-ratio: 1; background: #fff; overflow: hidden; }
.np-product-img img { width: 100%; height: 100%; object-fit: cover; }
.np-product-body { padding: 10px 12px 12px; }
.np-product-name {
	font-size: 0.78rem; font-weight: 600; line-height: 1.4;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.np-product-price { font-size: 0.82rem; font-weight: 700; color: var(--np-brand); margin-top: 6px; }
.np-shop-group { margin-bottom: 18px; }
.np-shop-group:last-child { margin-bottom: 0; }
.np-shop-group-head { margin-bottom: 10px; }
.np-shop-group-label { display: block; font-size: 0.72rem; color: var(--np-muted); margin-bottom: 2px; }
.np-shop-group-head strong { font-size: 0.9rem; }
.np-shop-browse { width: 100%; margin-top: 8px; text-align: center; }
.np-shop-by-item { padding: 16px; }
.np-overview-actions { display: flex; gap: 8px; margin-top: 8px; }
.np-overview-actions .np-btn { flex: 1; width: auto; }

.np-sheet-overlay {
	position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 200;
	display: flex; align-items: flex-end; justify-content: center;
	opacity: 0; transition: opacity 0.25s;
}
.np-sheet-overlay.is-open { opacity: 1; }
.np-sheet {
	background: var(--np-surface); border-radius: 20px 20px 0 0; width: 100%;
	max-width: 640px; max-height: 90vh; overflow-y: auto; padding: 24px 20px;
	transform: translateY(100%); transition: transform 0.3s ease;
	position: relative;
}
.np-sheet-overlay.is-open .np-sheet { transform: translateY(0); }
.np-sheet-close {
	position: absolute; top: 12px; left: 12px; width: 32px; height: 32px;
	border: none; background: var(--np-green-100); border-radius: 50%; font-size: 1.2rem; cursor: pointer;
}
.np-sheet-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 16px; padding-left: 36px; }
.np-textarea { resize: vertical; min-height: 60px; }
.np-radio-row { display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.np-member-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.np-member-picks.is-hidden { display: none; }
.np-member-pick {
	padding: 8px 12px; border: 2px solid var(--np-green-100); border-radius: 999px;
	background: transparent; font-family: inherit; font-size: 0.8rem; cursor: pointer;
}
.np-member-pick.is-selected { border-color: var(--chip-color, var(--np-green-500)); background: color-mix(in srgb, var(--chip-color, var(--np-green-500)) 15%, transparent); }
.np-qty-row { display: flex; align-items: center; gap: 8px; }
.np-qty-input { width: 80px; text-align: center; }
.np-stepper { width: 40px; height: 40px; border: 2px solid var(--np-green-100); border-radius: 10px; background: var(--np-surface); font-size: 1.2rem; cursor: pointer; }
.np-toggle-row { display: flex; gap: 8px; margin-top: 10px; }
.np-toggle-btn { flex: 1; padding: 10px; border: 2px solid var(--np-green-100); border-radius: 10px; background: transparent; font-family: inherit; cursor: pointer; font-size: 0.85rem; }
.np-toggle-btn.is-active { background: var(--np-green-100); border-color: var(--np-green-500); font-weight: 600; }
.np-qty-calc { font-size: 0.85rem; color: var(--np-muted); margin: 8px 0 0; }
.np-btn--danger { background: transparent; color: var(--np-accent); border: 2px solid var(--np-accent); width: 100%; margin-top: 8px; }

.np-bottom-bar .np-btn.is-active { background: var(--np-green-100); border-color: var(--np-green-500); }
.np-empty-state { text-align: center; color: var(--np-muted); padding: 24px; }
.np-muted { color: var(--np-muted); font-size: 0.85rem; }
.np-share-url { word-break: break-all; font-size: 0.85rem; margin: 4px 0 12px; }
.np-share-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#np-qr-canvas { display: block; margin: 16px auto; border-radius: 12px; }

.np-overview-member { margin-bottom: 14px; }
.np-overview-member-head { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; margin-bottom: 6px; }
.np-overview-member-head span:last-child { margin-right: auto; color: var(--np-muted); }
.np-overview-bar { height: 8px; background: var(--np-green-100); border-radius: 999px; overflow: hidden; }
.np-overview-bar-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.np-duplicate-warn { border: 2px solid var(--np-accent); }
.np-duplicate-warn ul { margin: 8px 0 0; padding-right: 20px; font-size: 0.85rem; }

.np-cat-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.np-cat-name { flex: 1; }

.np-progress-circle { transition: stroke-dashoffset 0.5s ease; }
@keyframes np-bounce { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.np-check.is-checked { animation: np-bounce 0.3s ease; }
@keyframes np-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.np-animate-in { animation: np-fade-in 0.3s ease; }

@media (min-width: 641px) {
	.np-sheet-overlay { align-items: center; }
	.np-sheet { border-radius: var(--np-radius); max-height: 85vh; transform: translateY(20px); }
	.np-sheet-overlay.is-open .np-sheet { transform: translateY(0); }
}
