/* Janatar Report Core — component styles (work with any theme). */

:where(.jr-card, .jr-emergency, .jr-progress) {
	--jr-ink: #111827;
	--jr-muted: #5b6472;
	--jr-border: #e3e7ec;
	--jr-red: #e10910;
	--jr-red-dark: #b8070d;
	--jr-green: #00552e;
	--jr-green-2: #0b6b35;
	--jr-blue: #0057b8;
	--jr-radius: 12px;
	box-sizing: border-box;
}
:where(.jr-card, .jr-emergency, .jr-progress) *,
:where(.jr-card, .jr-emergency, .jr-progress) *::before,
:where(.jr-card, .jr-emergency, .jr-progress) *::after { box-sizing: border-box; }

.jr-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.jr-ico { flex: none; display: inline-block; vertical-align: middle; }

/* ---------- Card ---------- */
.jr-card {
	background: #fff;
	border: 1px solid var(--jr-border);
	border-radius: var(--jr-radius);
	padding: 16px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .03);
	color: var(--jr-ink);
	container-type: inline-size;
}
.jr-card + .jr-card { margin-top: 14px; }
.jr-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.jr-card-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 21px; line-height: 1.3; font-weight: 700; color: var(--jr-ink); }
.jr-card-title-ico { display: inline-flex; color: var(--jr-green); }
.jr-more { display: inline-flex; align-items: center; gap: 4px; color: var(--jr-blue); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.jr-more:hover { text-decoration: underline; }
.jr-empty { color: var(--jr-muted); margin: 6px 0; }

/* ---------- Buttons ---------- */
.jr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.jr-btn--green { background: var(--jr-green); color: #fff; }
.jr-btn--green:hover { background: #003f22; color: #fff; }
.jr-btn--ghost { background: #fff; color: var(--jr-ink); border-color: #cfd5dc; }
.jr-btn--ghost:hover { border-color: var(--jr-green); color: var(--jr-green); }

/* ---------- Badges ---------- */
.jr-status { display: inline-block; padding: 4px 10px; border-radius: 5px; background: var(--jr-status, #64748b); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.35; white-space: nowrap; }
.jr-cat-badge { display: inline-block; padding: 2px 9px; border-radius: 4px; background: var(--jr-c, #00552e); color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.45; white-space: nowrap; }

/* ---------- Notices ---------- */
.jr-notice { display: block; padding: 10px 14px; border-radius: 8px; margin: 0 0 12px; font-size: 14.5px; line-height: 1.55; border: 1px solid transparent; }
.jr-notice ul { margin: 6px 0 0 18px; padding: 0; }
.jr-notice .jr-ico { margin-right: 4px; vertical-align: -3px; }
.jr-notice--error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.jr-notice--warn { background: #fffbeb; border-color: #fde68a; color: #854d0e; }
.jr-notice--danger { background: #fff1f1; border-color: #fecaca; color: #b91c1c; }

/* ---------- Report form ---------- */
.jrf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.jrf-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 24px; line-height: 1.25; font-weight: 700; color: var(--jr-ink); }
.jrf-title-ico { display: inline-flex; color: var(--jr-green); }

.jrf-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; cursor: pointer; user-select: none; }
.jrf-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.jrf-switch-ui { position: relative; width: 40px; height: 22px; border-radius: 22px; background: #cbd5e1; transition: background .2s; flex: none; }
.jrf-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.jrf-switch input:checked + .jrf-switch-ui { background: #0f3d2a; }
.jrf-switch input:checked + .jrf-switch-ui::after { transform: translateX(18px); }
.jrf-switch input:focus-visible + .jrf-switch-ui { outline: 2px solid var(--jr-green); outline-offset: 2px; }
.jrf-tip { display: inline-flex; color: #4b5563; cursor: help; }

.jrf-form { margin: 0; }
.jrf-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.jrf-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; }
.jrf-cat { position: relative; cursor: pointer; }
.jrf-cat input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.jrf-cat span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 6px; background: var(--jr-cl); color: var(--jr-c); font-weight: 600; font-size: 15px; line-height: 1.2; border: 1px solid transparent; transition: background .15s, color .15s; }
.jrf-cat:hover span { border-color: var(--jr-c); }
.jrf-cat input:checked + span { background: var(--jr-c); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.jrf-cat input:focus-visible + span { outline: 2px solid var(--jr-c); outline-offset: 2px; }

.jrf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.jrf-span-3 { grid-column: 1 / -1; }
.jrf-field { min-width: 0; }
.jrf-field > label { display: block; margin: 0 0 6px; font-weight: 600; font-size: 15px; color: var(--jr-ink); }
.jrf-field > label b, .jrf-check b { color: var(--jr-red); font-weight: 700; }

.jrf-input,
.jrf-select select {
	display: block; width: 100%; height: 40px; margin: 0; padding: 0 12px;
	border: 1px solid #d3d9e0; border-radius: 6px; background: #fff; color: var(--jr-ink);
	font: inherit; font-size: 14.5px; line-height: 1.4; box-shadow: none;
	transition: border-color .15s, box-shadow .15s;
}
textarea.jrf-input { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; }
.jrf-input::placeholder { color: #8a93a0; }
.jrf-input:focus, .jrf-select select:focus { outline: none; border-color: var(--jr-green); box-shadow: 0 0 0 3px rgba(0, 85, 46, .14); }
.jrf-select { position: relative; }
.jrf-select select {
	-webkit-appearance: none; appearance: none; padding-right: 34px; cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2.5' 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 10px center;
}
.jrf-select select:invalid, .jrf-select select option[value=""] { color: #6b7280; }
.jrf-select select option { color: var(--jr-ink); }
.jrf-affix { display: flex; align-items: stretch; border: 1px solid #d3d9e0; border-radius: 6px; background: #fff; overflow: hidden; }
.jrf-affix:focus-within { border-color: var(--jr-green); box-shadow: 0 0 0 3px rgba(0, 85, 46, .14); }
.jrf-affix-ico { display: grid; place-items: center; width: 40px; flex: none; border-right: 1px solid #e3e7ec; color: #4b5563; }
.jrf-affix .jrf-input { border: 0; border-radius: 0; box-shadow: none !important; height: 38px; }
.jrf-upz-other { margin-top: 8px; }
.jrf-form.is-js .jrf-upz-other:not(.is-visible) { display: none; }
.jrf-help { display: block; margin-top: 6px; color: var(--jr-muted); font-size: 12.5px; line-height: 1.5; }

.jrf-contact { padding: 12px; border: 1px dashed #a7d3b7; border-radius: 8px; background: #f5fbf7; }
.jrf-contact[hidden] { display: none; }
.jrf-contact-note { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 13.5px; color: #14532d; }
.jrf-contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.jrf-bottom { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-top: 14px; align-items: start; }
.jrf-upload-label { margin: 0 0 8px; font-weight: 700; font-size: 15px; }
.jrf-upload-label small { font-weight: 400; color: var(--jr-muted); font-size: 12.5px; }
.jrf-drop { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 108px; padding: 14px; border: 2px dashed #c4cbd3; border-radius: 10px; background: #fafbfc; cursor: pointer; transition: border-color .15s, background .15s; text-align: left; }
.jrf-drop:hover, .jrf-drop.is-over { border-color: var(--jr-green); background: #f2faf5; }
.jrf-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.jrf-drop:focus-within { outline: 2px solid var(--jr-green); outline-offset: 2px; }
.jrf-drop-ico { display: inline-flex; color: #6b7280; }
.jrf-drop-text strong { display: block; font-size: 16px; color: var(--jr-ink); }
.jrf-drop-text span { display: block; font-size: 14px; color: var(--jr-muted); }
.jrf-files { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.jrf-files:empty { display: none; }
.jrf-files li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--jr-border); border-radius: 6px; font-size: 13.5px; background: #fff; }
.jrf-files li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jrf-files li small { color: var(--jr-muted); }
.jrf-files li.is-bad { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.jrf-files button { border: 0; background: none; color: var(--jr-red); font: inherit; font-size: 13px; cursor: pointer; padding: 2px 4px; }

.jrf-actions { display: flex; flex-direction: column; gap: 12px; padding-top: 28px; }
.jrf-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.5; cursor: pointer; }
.jrf-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: #0b6b35; cursor: pointer; }
.jrf-check span { display: inline; }
.jrf-check .jr-ico { vertical-align: -2px; margin-left: 2px; }
.jrf-submit { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; padding: 10px 18px; border: 0; border-radius: 6px; background: var(--jr-red); color: #fff; font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px rgba(225, 9, 16, .25); transition: background .15s, transform .05s; }
.jrf-submit:hover { background: var(--jr-red-dark); }
.jrf-submit:active { transform: translateY(1px); }
.jrf-submit[disabled] { opacity: .7; cursor: progress; }
.jrf-notice { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid #eef0f3; color: var(--jr-muted); font-size: 13px; line-height: 1.6; }

/* Success */
.jrf-success { text-align: center; padding: 18px 8px 8px; }
.jrf-success-ico { display: inline-flex; color: var(--jr-green-2); }
.jrf-success h2 { margin: 8px 0 6px; font-size: 24px; }
.jrf-success > p { margin: 0 auto 14px; max-width: 560px; color: var(--jr-muted); }
.jrf-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 620px; margin: 0 auto 12px; }
.jrf-code { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px; border: 1px solid var(--jr-border); border-radius: 10px; background: #f8fafc; }
.jrf-code span { font-size: 13.5px; color: var(--jr-muted); }
.jrf-code strong { font-size: 24px; letter-spacing: 1px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--jr-ink); }
.jrf-copy { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid #cfd5dc; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.jrf-warn { display: flex; align-items: flex-start; gap: 8px; max-width: 620px; margin: 0 auto 16px !important; padding: 10px 12px; border-radius: 8px; background: #fffbeb; color: #854d0e !important; font-size: 14px; text-align: left; }
.jrf-success-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

/* ---------- Stats ---------- */
.jr-stats { display: grid; grid-template-columns: repeat(var(--jr-cols, 5), minmax(0, 1fr)); gap: 4px; }
.jr-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: 12px 6px; border-radius: 8px; background: var(--jr-cl); color: var(--jr-c); text-decoration: none; text-align: center; transition: transform .15s, box-shadow .15s; }
.jr-stat:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.06); }
.jr-stat-label { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; line-height: 1.2; }
.jr-stat strong { font-size: 26px; line-height: 1.1; font-weight: 800; }

/* ---------- Recent ---------- */
.jr-recent { list-style: none; margin: 0; padding: 0; }
.jr-recent-item { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid #eef0f3; }
.jr-recent-item:last-child { border-bottom: 0; padding-bottom: 0; }
.jr-recent-item:first-child { padding-top: 0; }
.jr-recent-thumb { display: block; width: 82px; height: 60px; border-radius: 6px; overflow: hidden; background: #e5e7eb; }
.jr-recent-thumb img, .jr-recent-thumb .jr-ph { display: block; width: 100%; height: 100%; object-fit: cover; }
.jr-recent-body { min-width: 0; }
.jr-recent-title { margin: 4px 0 2px; font-size: 16px; line-height: 1.35; font-weight: 700; }
.jr-recent-title a { color: var(--jr-ink); text-decoration: none; }
.jr-recent-title a:hover { color: var(--jr-green); }
.jr-meta { display: inline-flex; align-items: center; gap: 5px; color: var(--jr-muted); font-size: 13px; line-height: 1.4; }
.jr-meta .jr-ico { color: #6b7280; }
.jr-recent-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.jr-ph { display: grid; place-items: center; background: linear-gradient(135deg, var(--jr-c, #00552e), #1f2937); color: rgba(255,255,255,.85); }

/* ---------- Actions (before/after) ---------- */
.jr-actions { display: grid; grid-template-columns: repeat(var(--jr-cols, 4), minmax(0, 1fr)); gap: 16px; }
.jr-action { min-width: 0; }
.jr-ba { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 4px; text-decoration: none; }
.jr-ba-img { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: #e5e7eb; }
.jr-ba-img img, .jr-ba-img .jr-ph { display: block; width: 100%; height: 100%; object-fit: cover; }
.jr-ba-tag { position: absolute; top: 4px; left: 4px; z-index: 1; padding: 1px 6px; border-radius: 3px; background: rgba(17, 24, 39, .65); color: #fff; font-size: 11px; line-height: 1.5; }
.jr-ba-tag--after { background: rgba(11, 107, 53, .9); }
.jr-ba-arrow { display: inline-flex; color: var(--jr-green); }
.jr-action-badges { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 8px 0 4px; flex-wrap: wrap; }
.jr-action-badges .jr-status { font-size: 12px; padding: 3px 8px; }
.jr-action-title { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 600; }
.jr-action-title a { color: var(--jr-ink); text-decoration: none; }
.jr-action-title a:hover { color: var(--jr-green); }

/* ---------- Timeline ---------- */
.jr-timeline { list-style: none; margin: 12px 0; padding: 0; }
.jr-timeline li { position: relative; display: flex; gap: 12px; padding: 0 0 16px; }
.jr-timeline li::before { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 2px; background: #e5e7eb; }
.jr-timeline li:last-child::before { display: none; }
.jr-tl-dot { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 4px solid var(--jr-status); background: #fff; }
.jr-tl-body { min-width: 0; }
.jr-tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.jr-tl-head strong { color: var(--jr-status); font-size: 15px; }
.jr-tl-head time { color: var(--jr-muted); font-size: 13px; }
.jr-tl-body p { margin: 2px 0 0; font-size: 14.5px; line-height: 1.55; color: #374151; }

/* ---------- Tracking ---------- */
.jr-track-intro { margin: 0 0 12px; color: var(--jr-muted); font-size: 14.5px; }
.jr-track-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.jr-track-form .jr-btn { height: 40px; }
.jr-track-result { margin-top: 16px; padding-top: 16px; border-top: 1px solid #eef0f3; }
.jr-track-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.jr-label { display: block; color: var(--jr-muted); font-size: 13px; }
.jr-track-number { font-size: 22px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.jr-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0 0 8px; }
.jr-dl div { min-width: 0; }
.jr-dl dt { color: var(--jr-muted); font-size: 13px; }
.jr-dl dd { margin: 2px 0 0; font-weight: 600; font-size: 15px; }
.jr-dl dd .jr-ico { color: var(--jr-green); vertical-align: -2px; }
.jr-track + .jr-notice, .jr-track .jr-notice { margin-top: 14px; }

/* ---------- Progress ---------- */
.jr-progress > * + * { margin-top: 14px; }
.jr-progress-total { margin: 0 0 12px; color: var(--jr-muted); }
.jr-progress-total strong { color: var(--jr-ink); font-size: 20px; }
.jr-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.jr-bar-head { display: flex; justify-content: space-between; font-size: 14.5px; margin-bottom: 4px; }
.jr-bar-head strong { color: var(--jr-status); }
.jr-bar { height: 10px; border-radius: 10px; background: #eef0f3; overflow: hidden; }
.jr-bar span { display: block; height: 100%; min-width: 4px; border-radius: 10px; background: var(--jr-status); }

/* ---------- Emergency ---------- */
.jr-emergency { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--jr-radius); background: linear-gradient(160deg, #ffe7e8, #fff5f5); border: 1px solid #fde1e2; color: var(--jr-ink); }
.jr-emergency-ico { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--jr-red); color: #fff; box-shadow: 0 4px 10px rgba(225, 9, 16, .3); text-decoration: none; }
.jr-emergency-title { margin: 0 0 6px; color: var(--jr-red); font-size: 21px; line-height: 1.3; font-weight: 700; }
.jr-emergency-line { margin: 0 0 6px; font-size: 19px; font-weight: 700; line-height: 1.3; }
.jr-emergency-line a { color: var(--jr-red); text-decoration: none; }
.jr-emergency-text { margin: 0; font-size: 14px; line-height: 1.55; color: #374151; }

/* ---------- Report details / gallery ---------- */
.jr-details { margin-top: 18px; }
.jr-details-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.jr-sub { margin: 18px 0 6px; font-size: 18px; }
.jr-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.jr-gallery img, .jr-gallery video { display: block; width: 100%; height: 130px; object-fit: cover; border-radius: 6px; background: #000; }
.jr-disclaimer { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: #f8fafc; border: 1px solid #eef0f3; color: var(--jr-muted); font-size: 13.5px; line-height: 1.55; }

/* ---------- Container-based responsiveness ---------- */
@container (max-width: 640px) {
	.jrf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.jrf-bottom { grid-template-columns: 1fr; }
	.jrf-actions { padding-top: 0; }
	.jrf-contact-grid { grid-template-columns: 1fr; }
	.jr-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.jr-track-form { grid-template-columns: 1fr; }
}
@container (max-width: 400px) {
	.jrf-grid { grid-template-columns: 1fr; }
	.jrf-title { font-size: 21px; }
	.jrf-cat span { padding: 7px 12px; font-size: 14px; }
	.jrf-codes { grid-template-columns: 1fr; }
	.jr-recent-item { grid-template-columns: 72px minmax(0, 1fr); }
	.jr-recent-thumb { width: 72px; height: 56px; }
	.jr-recent-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
	.jr-actions { grid-template-columns: 1fr; }
	.jr-dl { grid-template-columns: 1fr; }
}

@container (max-width: 440px) {
	.jr-stat { padding: 10px 4px; }
	.jr-stat-label { font-size: 12.5px; gap: 3px; }
	.jr-stat-label .jr-ico { width: 18px; height: 18px; }
	.jr-stat strong { font-size: 24px; }
}
@container (max-width: 360px) {
	.jr-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Fallback for browsers without container queries. */
@supports not (container-type: inline-size) {
	@media (max-width: 700px) {
		.jrf-grid, .jrf-bottom, .jrf-contact-grid, .jr-track-form { grid-template-columns: 1fr; }
		.jr-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
		.jr-actions { grid-template-columns: 1fr; }
	}
}
