/* ==========================================================================
   Janasewa design system – tokens, scoped reset, components.
   Everything is scoped under .jsw so theme CSS cannot break it (and we never break the theme).
   Brand colours (--jsw-primary / --jsw-accent) are injected from settings.
   ========================================================================== */
:root {
	--jsw-primary: #123c8c;
	--jsw-accent: #d7263d;
	--jsw-primary-700: color-mix(in srgb, var(--jsw-primary) 70%, #000);
	--jsw-primary-600: color-mix(in srgb, var(--jsw-primary) 86%, #000);
	--jsw-primary-400: color-mix(in srgb, var(--jsw-primary) 75%, #fff);
	--jsw-primary-100: color-mix(in srgb, var(--jsw-primary) 13%, #fff);
	--jsw-primary-50: color-mix(in srgb, var(--jsw-primary) 6%, #fff);
	--jsw-accent-600: color-mix(in srgb, var(--jsw-accent) 84%, #000);
	--jsw-accent-100: color-mix(in srgb, var(--jsw-accent) 12%, #fff);
	--jsw-ink: #0b1324;
	--jsw-ink-2: #1e293b;
	--jsw-text: #334155;
	--jsw-muted: #64748b;
	--jsw-subtle: #94a3b8;
	--jsw-line: #e3e8f0;
	--jsw-line-2: #cfd7e3;
	--jsw-bg: #f5f7fb;
	--jsw-surface: #ffffff;
	--jsw-surface-2: #f1f4f9;
	--jsw-surface-3: #e8edf5;
	--jsw-ok: #15803d;
	--jsw-ok-bg: #ecfdf3;
	--jsw-warn: #b45309;
	--jsw-warn-bg: #fff7e6;
	--jsw-err: #c81e1e;
	--jsw-err-bg: #fef2f2;
	--jsw-info: #1d4ed8;
	--jsw-info-bg: #eff6ff;
	--jsw-font: "Mukta", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--jsw-display: "Mukta", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
	--jsw-r-sm: 8px;
	--jsw-r: 12px;
	--jsw-r-lg: 18px;
	--jsw-r-xl: 28px;
	--jsw-sh-1: 0 1px 2px rgba(11, 19, 36, .06), 0 1px 1px rgba(11, 19, 36, .03);
	--jsw-sh-2: 0 6px 18px rgba(11, 19, 36, .08), 0 2px 4px rgba(11, 19, 36, .05);
	--jsw-sh-3: 0 22px 56px rgba(11, 19, 36, .16), 0 6px 16px rgba(11, 19, 36, .08);
	--jsw-ring: 0 0 0 3px color-mix(in srgb, var(--jsw-primary) 32%, transparent);
	--jsw-container: 1240px;
	--jsw-gutter: clamp(16px, 4vw, 32px);
	--jsw-header-h: 72px;
	--jsw-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- scoped reset ---------- */
.jsw, .jsw *, .jsw *::before, .jsw *::after { box-sizing: border-box; }
.jsw {
	font-family: var(--jsw-font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--jsw-text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
/* Reset rules use .jsw :where(...) so they weigh the same as one class –
   component classes declared later always win, theme element styles do not leak in. */
.jsw :where(h1, h2, h3, h4, h5) {
	font-family: var(--jsw-display);
	color: var(--jsw-ink);
	font-weight: 700;
	line-height: 1.22;
	letter-spacing: 0;
	margin: 0;
	padding: 0;
	text-wrap: balance;
	border: 0;
	text-transform: none;
	background: none;
}
.jsw :where(p, figure, blockquote, dl, dd) { margin: 0; }
.jsw :where(ul, ol) { margin: 0; padding: 0; }
.jsw :where(img, svg, video) { max-width: 100%; }
.jsw :where(img) { height: auto; border: 0; }
.jsw :where(a) { color: var(--jsw-primary); text-decoration: none; box-shadow: none; }
.jsw :where(a):hover { color: var(--jsw-primary-700); }
.jsw :where(button, input, select, textarea) { font: inherit; color: inherit; letter-spacing: normal; text-transform: none; }
.jsw :where(button) { cursor: pointer; }
.jsw [hidden] { display: none !important; }
.jsw :focus-visible { outline: none; box-shadow: var(--jsw-ring); border-radius: 6px; }
.jsw :where(table) { border-collapse: collapse; }
.jsw .leaflet-container img { max-width: none !important; }
.jsw .leaflet-container a { color: var(--jsw-primary); }

.jsw-i {
	width: 1.25em;
	height: 1.25em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	vertical-align: -.22em;
}
.jsw-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.jsw-num { font-variant-numeric: tabular-nums; }
.jsw-muted { color: var(--jsw-muted); }
@media (max-width: 560px) { .jsw-hide-sm { display: none !important; } }

/* ---------- layout ---------- */
.jsw-container {
	width: 100%;
	max-width: var(--jsw-container);
	margin-inline: auto;
	padding-left: max(var(--jsw-gutter), env(safe-area-inset-left, 0px));
	padding-right: max(var(--jsw-gutter), env(safe-area-inset-right, 0px));
}
.jsw-container--narrow { max-width: 860px; }
.jsw-pad { padding-block: clamp(28px, 5vw, 56px); }
.jsw-stack { display: flex; flex-direction: column; gap: 12px; }
.jsw-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.jsw-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .jsw-grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- buttons ---------- */
.jsw-btn {
	--b-bg: var(--jsw-primary);
	--b-fg: #fff;
	--b-bd: var(--jsw-primary);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 0 20px;
	border-radius: 11px;
	border: 1.5px solid var(--b-bd);
	background: var(--b-bg);
	color: var(--b-fg) !important;
	font-family: var(--jsw-font);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .18s var(--jsw-ease), border-color .18s, color .18s, box-shadow .18s, transform .06s;
	-webkit-tap-highlight-color: transparent;
	position: relative;
	user-select: none;
}
.jsw-btn:hover { --b-bg: var(--jsw-primary-600); --b-bd: var(--jsw-primary-600); }
.jsw-btn:active { transform: translateY(1px); }
.jsw-btn:focus-visible { box-shadow: var(--jsw-ring); border-radius: 11px; }
.jsw-btn[disabled], .jsw-btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.jsw-btn .jsw-i { width: 1.15em; height: 1.15em; }
.jsw-btn--accent { --b-bg: var(--jsw-accent); --b-bd: var(--jsw-accent); }
.jsw-btn--accent:hover { --b-bg: var(--jsw-accent-600); --b-bd: var(--jsw-accent-600); }
.jsw-btn--light { --b-bg: #fff; --b-fg: var(--jsw-primary); --b-bd: #fff; }
.jsw-btn--light:hover { --b-bg: var(--jsw-primary-50); --b-bd: var(--jsw-primary-50); }
.jsw-btn--glass { --b-bg: rgba(255, 255, 255, .1); --b-fg: #fff; --b-bd: rgba(255, 255, 255, .45); backdrop-filter: blur(6px); }
.jsw-btn--glass:hover { --b-bg: rgba(255, 255, 255, .2); --b-bd: #fff; }
.jsw-btn--ghost { --b-bg: transparent; --b-fg: var(--jsw-ink-2); --b-bd: var(--jsw-line-2); }
.jsw-btn--ghost:hover { --b-bg: var(--jsw-surface-2); --b-bd: var(--jsw-line-2); }
.jsw-btn--soft { --b-bg: var(--jsw-primary-50); --b-fg: var(--jsw-primary); --b-bd: var(--jsw-primary-50); }
.jsw-btn--soft:hover { --b-bg: var(--jsw-primary-100); --b-bd: var(--jsw-primary-100); }
.jsw-btn--danger { --b-bg: #fff; --b-fg: var(--jsw-err); --b-bd: color-mix(in srgb, var(--jsw-err) 40%, #fff); }
.jsw-btn--danger:hover { --b-bg: var(--jsw-err-bg); --b-bd: var(--jsw-err); }
.jsw-btn--ok { --b-bg: var(--jsw-ok); --b-bd: var(--jsw-ok); }
.jsw-btn--ok:hover { --b-bg: color-mix(in srgb, var(--jsw-ok) 85%, #000); --b-bd: color-mix(in srgb, var(--jsw-ok) 85%, #000); }
.jsw-btn--sm { min-height: 36px; padding: 0 13px; font-size: 14.5px; border-radius: 9px; }
.jsw-btn--xs { min-height: 30px; padding: 0 10px; font-size: 13.5px; border-radius: 8px; gap: 5px; }
.jsw-btn--lg { min-height: 54px; padding: 0 26px; font-size: 17px; border-radius: 13px; }
.jsw-btn--block { width: 100%; }
.jsw-btn--icon { padding: 0; width: 46px; }
.jsw-btn--sm.jsw-btn--icon { width: 36px; }
.jsw-btn--xs.jsw-btn--icon { width: 30px; }
.jsw-btn.is-loading { color: transparent !important; pointer-events: none; }
.jsw-btn.is-loading::after {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	border: 2.5px solid var(--b-fg);
	border-right-color: transparent;
	border-radius: 50%;
	animation: jsw-spin .7s linear infinite;
}
.jsw-btn.is-loading .jsw-i { opacity: 0; }
.jsw-link { background: none; border: 0; padding: 0; color: var(--jsw-primary); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.jsw-link:hover { text-decoration: underline; }

/* ---------- forms ---------- */
.jsw-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.jsw-label { font-size: 15px; font-weight: 600; color: var(--jsw-ink-2); display: flex; align-items: baseline; gap: 6px; }
.jsw-label .jsw-opt { font-weight: 400; color: var(--jsw-subtle); font-size: 13.5px; }
.jsw-req { color: var(--jsw-accent); }
.jsw-hint { font-size: 13.5px; color: var(--jsw-muted); line-height: 1.45; }
.jsw-ferr { font-size: 13.5px; color: var(--jsw-err); font-weight: 500; }
.jsw-input, .jsw-select, .jsw-textarea {
	width: 100%;
	min-height: 48px;
	padding: 11px 14px;
	border: 1.5px solid var(--jsw-line-2);
	border-radius: 11px;
	background: #fff;
	color: var(--jsw-ink);
	font-size: 16px;
	line-height: 1.4;
	transition: border-color .15s, box-shadow .15s;
	box-shadow: none;
	margin: 0;
	appearance: none;
	-webkit-appearance: none;
}
.jsw-input::placeholder, .jsw-textarea::placeholder { color: var(--jsw-subtle); }
.jsw-input:hover, .jsw-select:hover, .jsw-textarea:hover { border-color: var(--jsw-subtle); }
.jsw-input:focus, .jsw-select:focus, .jsw-textarea:focus { outline: none; border-color: var(--jsw-primary); box-shadow: var(--jsw-ring); }
.jsw-input.is-invalid, .jsw-select.is-invalid, .jsw-textarea.is-invalid { border-color: var(--jsw-err); }
.jsw-textarea { min-height: 120px; resize: vertical; }
.jsw-select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 18px;
	cursor: pointer;
}
.jsw-input--sm, .jsw-select--sm { min-height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: 15px; border-radius: 9px; }
.jsw-inputwrap { position: relative; display: flex; align-items: center; }
.jsw-inputwrap > .jsw-i { position: absolute; left: 14px; color: var(--jsw-subtle); pointer-events: none; }
.jsw-inputwrap > .jsw-input { padding-left: 42px; }
.jsw-check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; cursor: pointer; line-height: 1.45; }
.jsw-check input[type=checkbox], .jsw-check input[type=radio] { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--jsw-primary); flex: none; cursor: pointer; }
.jsw-switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; }
.jsw-switch input { position: absolute; opacity: 0; pointer-events: none; }
.jsw-switch__track { width: 44px; height: 26px; border-radius: 99px; background: var(--jsw-line-2); position: relative; flex: none; transition: background .2s; }
.jsw-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--jsw-ease); }
.jsw-switch input:checked + .jsw-switch__track { background: var(--jsw-primary); }
.jsw-switch input:checked + .jsw-switch__track::after { transform: translateX(18px); }
.jsw-switch input:focus-visible + .jsw-switch__track { box-shadow: var(--jsw-ring); }
.jsw-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- chips, badges ---------- */
.jsw-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border-radius: 99px;
	background: var(--jsw-surface-2);
	color: var(--jsw-ink-2);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}
.jsw-chip .jsw-i { width: 14px; height: 14px; }
.jsw-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--jsw-subtle)); flex: none; }
.jsw-chip--cat { background: color-mix(in srgb, var(--c) 11%, #fff); color: color-mix(in srgb, var(--c) 78%, #000); }
.jsw-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px 3px 8px;
	border-radius: 99px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.5;
	white-space: nowrap;
	color: color-mix(in srgb, var(--c, #64748b) 82%, #000);
	background: color-mix(in srgb, var(--c, #64748b) 12%, #fff);
	border: 1px solid color-mix(in srgb, var(--c, #64748b) 24%, #fff);
}
.jsw-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, #64748b); }
.jsw-badge--plain::before { display: none; }
.jsw-count {
	display: inline-grid;
	place-items: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 99px;
	background: var(--jsw-surface-3);
	color: var(--jsw-ink-2);
	font-size: 12.5px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* ---------- cards, callouts ---------- */
.jsw-card {
	background: var(--jsw-surface);
	border: 1px solid var(--jsw-line);
	border-radius: var(--jsw-r-lg);
	box-shadow: var(--jsw-sh-1);
	min-width: 0;
}
.jsw-card--pad { padding: clamp(18px, 3vw, 28px); }
.jsw-callout {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 14px 16px;
	border-radius: var(--jsw-r);
	background: var(--jsw-info-bg);
	color: #1e3a8a;
	font-size: 15px;
	line-height: 1.5;
	border: 1px solid color-mix(in srgb, var(--jsw-info) 18%, #fff);
}
.jsw-callout > .jsw-i { margin-top: 2px; }
.jsw-callout--warn { background: var(--jsw-warn-bg); color: #7c2d12; border-color: #fde3b0; }
.jsw-callout--err { background: var(--jsw-err-bg); color: #7f1d1d; border-color: #fecaca; }
.jsw-callout--ok { background: var(--jsw-ok-bg); color: #14532d; border-color: #bbf7d0; }
.jsw-callout--private { background: #f1f5f9; color: var(--jsw-ink-2); border-color: var(--jsw-line-2); }

/* ---------- empty / skeleton / spinner ---------- */
.jsw-empty { text-align: center; padding: 48px 20px; color: var(--jsw-muted); }
.jsw-empty__icon { width: 56px; height: 56px; border-radius: 16px; background: var(--jsw-surface-2); color: var(--jsw-subtle); display: grid; place-items: center; margin: 0 auto 14px; }
.jsw-empty__icon .jsw-i { width: 28px; height: 28px; }
.jsw-empty h3 { font-size: 18px; margin-bottom: 6px; }
.jsw-skel { background: linear-gradient(90deg, var(--jsw-surface-2) 0%, var(--jsw-surface-3) 50%, var(--jsw-surface-2) 100%); background-size: 200% 100%; animation: jsw-shimmer 1.3s linear infinite; border-radius: 8px; }
.jsw-spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid var(--jsw-primary-100); border-top-color: var(--jsw-primary); border-radius: 50%; animation: jsw-spin .75s linear infinite; }
@keyframes jsw-spin { to { transform: rotate(360deg); } }
@keyframes jsw-shimmer { to { background-position: -200% 0; } }

/* ---------- segmented / tabs ---------- */
.jsw-seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--jsw-surface-2); border-radius: 12px; border: 1px solid var(--jsw-line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.jsw-seg::-webkit-scrollbar { display: none; }
.jsw-seg button {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 0;
	background: transparent;
	padding: 7px 13px;
	border-radius: 9px;
	font-weight: 600;
	font-size: 14.5px;
	color: var(--jsw-muted);
	white-space: nowrap;
	transition: background .15s, color .15s;
}
.jsw-seg button:hover { color: var(--jsw-ink); }
.jsw-seg button[aria-pressed="true"], .jsw-seg button[aria-selected="true"] { background: #fff; color: var(--jsw-ink); box-shadow: var(--jsw-sh-1); }
.jsw-seg button .jsw-count { height: 20px; min-width: 20px; font-size: 12px; background: var(--jsw-surface-3); }
.jsw-seg button[aria-pressed="true"] .jsw-count { background: var(--jsw-primary); color: #fff; }

/* ---------- status progress (दर्ता → समाधान) ---------- */
.jsw-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; position: relative; margin: 4px 0; }
.jsw-progress__step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; font-size: 12.5px; color: var(--jsw-subtle); font-weight: 600; }
.jsw-progress__step::before { content: ""; position: absolute; top: 11px; left: -50%; right: 50%; height: 3px; background: var(--jsw-line); z-index: 0; }
.jsw-progress__step:first-child::before { display: none; }
.jsw-progress__dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2.5px solid var(--jsw-line-2); display: grid; place-items: center; color: #fff; }
.jsw-progress__dot .jsw-i { width: 14px; height: 14px; stroke-width: 3; }
.jsw-progress__step.is-done { color: var(--jsw-ink-2); }
.jsw-progress__step.is-done::before { background: var(--pc, var(--jsw-primary)); }
.jsw-progress__step.is-done .jsw-progress__dot { background: var(--pc, var(--jsw-primary)); border-color: var(--pc, var(--jsw-primary)); }
.jsw-progress__step.is-current .jsw-progress__dot { box-shadow: 0 0 0 5px color-mix(in srgb, var(--pc, var(--jsw-primary)) 20%, transparent); }
.jsw-progress--sm .jsw-progress__step { font-size: 11.5px; }

/* ---------- avatar ---------- */
.jsw-avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--av, var(--jsw-primary)); flex: none; overflow: hidden; }
.jsw-avatar img { width: 100%; height: 100%; object-fit: cover; }
.jsw-avatar--sm { width: 26px; height: 26px; font-size: 12px; }
.jsw-avatar--lg { width: 48px; height: 48px; font-size: 18px; }

/* ---------- toast ---------- */
.jsw-toasts { position: fixed; z-index: 100000; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.jsw-toast {
	pointer-events: auto;
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 12px 16px;
	border-radius: 12px;
	background: var(--jsw-ink);
	color: #fff;
	font-family: var(--jsw-font);
	font-size: 15px;
	line-height: 1.4;
	box-shadow: var(--jsw-sh-3);
	animation: jsw-toast-in .28s var(--jsw-ease);
}
.jsw-toast .jsw-i { flex: none; }
.jsw-toast--ok .jsw-i { color: #4ade80; }
.jsw-toast--err .jsw-i { color: #f87171; }
.jsw-toast.is-out { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes jsw-toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- dialog / sheet ---------- */
.jsw-overlay { position: fixed; inset: 0; z-index: 99990; background: rgba(11, 19, 36, .48); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: jsw-fade .2s; }
.jsw-dialog { width: min(100%, 560px); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: var(--jsw-r-lg); box-shadow: var(--jsw-sh-3); animation: jsw-pop .24s var(--jsw-ease); }
.jsw-dialog--wide { width: min(100%, 880px); }
.jsw-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--jsw-line); position: sticky; top: 0; background: #fff; z-index: 2; }
.jsw-dialog__head h2 { font-size: 18px; }
.jsw-dialog__body { padding: 20px; }
.jsw-dialog__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--jsw-line); background: var(--jsw-surface-2); position: sticky; bottom: 0; }
@media (max-width: 640px) {
	.jsw-overlay { align-items: flex-end; padding: 0; }
	.jsw-dialog { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; animation: jsw-sheet .3s var(--jsw-ease); padding-bottom: env(safe-area-inset-bottom, 0px); }
}
@keyframes jsw-fade { from { opacity: 0; } }
@keyframes jsw-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes jsw-sheet { from { transform: translateY(100%); } }

/* ---------- lightbox ---------- */
.jsw-lightbox { position: fixed; inset: 0; z-index: 100001; background: rgba(5, 8, 16, .92); display: flex; align-items: center; justify-content: center; animation: jsw-fade .2s; }
.jsw-lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 10px; box-shadow: var(--jsw-sh-3); object-fit: contain; }
.jsw-lightbox__close, .jsw-lightbox__nav { position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.jsw-lightbox__close { top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; }
.jsw-lightbox__nav--prev { left: 16px; }
.jsw-lightbox__nav--next { right: 16px; }
.jsw-lightbox__cap { position: absolute; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); color: #e2e8f0; font-size: 14px; }

/* ---------- photo grid ---------- */
.jsw-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.jsw-photos button { border: 0; padding: 0; background: var(--jsw-surface-2); border-radius: 10px; overflow: hidden; aspect-ratio: 1; cursor: zoom-in; position: relative; }
.jsw-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jsw-photos__tag { position: absolute; left: 6px; bottom: 6px; background: rgba(11, 19, 36, .72); color: #fff; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; }

/* ==========================================================================
   Map widget
   ========================================================================== */
.jsw-map { position: relative; border-radius: var(--jsw-r-lg); overflow: hidden; background: #dfe6ee; isolation: isolate; min-height: 260px; }
.jsw-map__canvas { position: absolute; inset: 0; z-index: 0; background: #e5ebf2; }
.jsw-map__canvas.leaflet-container { font-family: var(--jsw-font); }
.jsw-map.is-fullscreen { position: fixed !important; inset: 0 !important; z-index: 99995 !important; border-radius: 0 !important; height: 100% !important; min-height: 0 !important; margin: 0 !important; }
.jsw-map__top { position: absolute; z-index: 500; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; pointer-events: none; }
.jsw-map__top > * { pointer-events: auto; }
.jsw-map.is-fullscreen .jsw-map__top { top: calc(12px + env(safe-area-inset-top, 0px)); }
.jsw-mapsearch { position: relative; flex: 1; min-width: 0; max-width: 520px; }
.jsw-mapsearch__box { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 6px 0 14px; background: #fff; border-radius: 12px; box-shadow: var(--jsw-sh-2); border: 1px solid var(--jsw-line); }
.jsw-mapsearch__box:focus-within { box-shadow: var(--jsw-sh-2), var(--jsw-ring); border-color: var(--jsw-primary); }
.jsw-mapsearch__box .jsw-i { color: var(--jsw-muted); }
.jsw-mapsearch input { flex: 1; min-width: 0; border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important; height: 44px; font-size: 16px; padding: 0 !important; color: var(--jsw-ink); }
.jsw-mapsearch input::-webkit-search-cancel-button, .jsw-mapsearch input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.jsw-mapsearch__clear { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 8px; color: var(--jsw-muted); display: grid; place-items: center; }
.jsw-mapsearch__list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border-radius: 12px; box-shadow: var(--jsw-sh-3); border: 1px solid var(--jsw-line); overflow: hidden; max-height: min(320px, 50vh); overflow-y: auto; list-style: none; margin: 0; padding: 6px; }
.jsw-mapsearch__list li { list-style: none; }
.jsw-mapsearch__item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.jsw-mapsearch__item:hover, .jsw-mapsearch__item.is-active { background: var(--jsw-primary-50); }
.jsw-mapsearch__item .jsw-i { color: var(--jsw-primary); margin-top: 3px; }
.jsw-mapsearch__item strong { display: block; color: var(--jsw-ink); font-weight: 600; font-size: 15px; line-height: 1.35; }
.jsw-mapsearch__item small { display: block; color: var(--jsw-muted); font-size: 13px; line-height: 1.35; }
.jsw-mapsearch__msg { padding: 12px; color: var(--jsw-muted); font-size: 14px; }
.jsw-mapctl { position: absolute; z-index: 500; right: 12px; display: flex; flex-direction: column; gap: 8px; }
.jsw-mapctl--top { top: 70px; }
.jsw-mapctl--bottom { bottom: 122px; }
@media (pointer: coarse) {
	.jsw-map .leaflet-control-zoom { display: none; }
	.jsw-mapctl--bottom { bottom: 28px; }
}
.jsw-map.no-search .jsw-mapctl--top { top: 12px; }
.jsw-mapbtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--jsw-line); background: #fff; color: var(--jsw-ink-2); display: grid; place-items: center; box-shadow: var(--jsw-sh-2); cursor: pointer; transition: background .15s, color .15s; }
.jsw-mapbtn:hover { background: var(--jsw-primary-50); color: var(--jsw-primary); }
.jsw-mapbtn.is-on { background: var(--jsw-primary); color: #fff; border-color: var(--jsw-primary); }
.jsw-mapbtn.is-busy .jsw-i { animation: jsw-spin 1s linear infinite; }
.jsw-mapbtn--locate { width: auto; padding: 0 14px; display: inline-flex; gap: 8px; font-weight: 600; font-size: 14.5px; }
.jsw-map .leaflet-control-zoom { border: 0 !important; box-shadow: var(--jsw-sh-2) !important; border-radius: 12px !important; overflow: hidden; margin: 0 12px 28px 0 !important; }
.jsw-map .leaflet-control-zoom a { width: 44px !important; height: 40px !important; line-height: 40px !important; font-size: 20px !important; color: var(--jsw-ink-2) !important; }
.jsw-map .leaflet-control-attribution { font-size: 10.5px; background: rgba(255, 255, 255, .78) !important; }
.jsw-map__pin { position: absolute; z-index: 450; left: 50%; top: 50%; width: 44px; height: 56px; margin: -56px 0 0 -22px; pointer-events: none; transition: transform .18s var(--jsw-ease); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .28)); }
.jsw-map__pin svg { width: 44px; height: 56px; }
.jsw-map__pin::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 12px; height: 5px; margin-left: -6px; border-radius: 50%; background: rgba(0, 0, 0, .3); transition: transform .18s, opacity .18s; filter: blur(1px); }
.jsw-map.is-moving .jsw-map__pin { transform: translateY(-10px); }
.jsw-map.is-moving .jsw-map__pin::after { transform: translateY(10px) scale(.7); opacity: .5; }
.jsw-map__status { position: absolute; z-index: 500; left: 12px; bottom: 28px; max-width: calc(100% - 84px); background: #fff; border-radius: 12px; padding: 9px 13px; box-shadow: var(--jsw-sh-2); font-size: 14px; line-height: 1.35; color: var(--jsw-ink-2); border: 1px solid var(--jsw-line); }
.jsw-map__status strong { display: block; font-size: 14.5px; color: var(--jsw-ink); }
.jsw-map__status small { color: var(--jsw-muted); font-size: 12.5px; }
.jsw-map__notice { position: absolute; z-index: 600; left: 50%; top: 66px; transform: translateX(-50%); background: var(--jsw-ink); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 14px; box-shadow: var(--jsw-sh-2); max-width: calc(100% - 24px); text-align: center; }
.jsw-map__loading { position: absolute; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(229, 235, 242, .6); pointer-events: none; }

/* Marker pins (divIcon) */
.jsw-mk { background: none !important; border: 0 !important; }
.jsw-mk__pin { position: relative; width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--c, var(--jsw-primary)); border: 2.5px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); display: grid; place-items: center; }
.jsw-mk__pin .jsw-i { transform: rotate(45deg); color: #fff; width: 15px; height: 15px; stroke-width: 2.2; }
.jsw-mk.is-done .jsw-mk__pin { background: #fff; border-color: var(--jsw-ok); }
.jsw-mk.is-done .jsw-mk__pin .jsw-i { color: var(--jsw-ok); }
.jsw-mk.is-active .jsw-mk__pin { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 30%, transparent), 0 3px 8px rgba(0, 0, 0, .3); }
.jsw-mk--dot .jsw-mk__pin { width: 18px; height: 18px; border-radius: 50%; transform: none; border-width: 2px; }
.jsw-cluster { background: none !important; }
.jsw-cluster div { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--jsw-primary); color: #fff; font-weight: 700; font-size: 14px; border: 3px solid #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--jsw-primary) 25%, transparent), 0 3px 8px rgba(0, 0, 0, .25); font-family: var(--jsw-font); }
.jsw-map .leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--jsw-sh-3); }
.jsw-map .leaflet-popup-content { margin: 12px 14px; font-family: var(--jsw-font); font-size: 14px; line-height: 1.45; min-width: 200px; }
.jsw-pop strong { display: block; color: var(--jsw-ink); font-size: 15px; }
.jsw-pop p { margin: 6px 0 8px; color: var(--jsw-text); }

@media (prefers-reduced-motion: reduce) {
	.jsw *, .jsw *::before, .jsw *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
