@font-face {
  font-family: "Noto Sans Bengali";
  src: url("../fonts/NotoSansBengali-bengali.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8,
    U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC,
    U+A8F1;
}
@font-face {
  font-family: "Noto Sans Bengali";
  src: url("../fonts/NotoSansBengali-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #f6f8f6;
  --card: #fff;
  --ink: #15221c;
  --muted: #6b756f;
  --line: #e2e8e4;
  --brand: #0b6b4b;
  --brand2: #11986b;
  --soft: #e8f4ef;
  --map: #dfe7e2;
  --danger: #b72c3d;
  --shadow: 0 12px 34px rgba(21, 34, 28, 0.07);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans Bengali", system-ui, sans-serif;
  line-height: 1.55;
}
.shell {
  width: min(1180px, calc(100% - 32px));
  margin: auto;
}
.top {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.nav {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
}
.ghost,
.text-btn {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}
.ghost {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
}
.hero {
  text-align: center;
  padding: 54px 12px 32px;
}
.eyebrow {
  display: inline-block;
  background: var(--soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
  border-radius: 99px;
  padding: 6px 12px;
}
.hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.15;
  margin: 16px auto 12px;
  letter-spacing: -0.03em;
}
.hero em {
  font-style: normal;
  color: var(--brand);
}
.hero p {
  max-width: 690px;
  margin: auto;
  color: var(--muted);
  font-size: 17px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 auto 22px;
  max-width: 760px;
}
.stats div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  text-align: center;
}
.stats strong {
  display: block;
  font-size: 26px;
  color: var(--brand);
  line-height: 1.2;
}
.stats span {
  font-size: 13px;
  color: var(--muted);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 20px;
  align-items: start;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.map-card {
  padding: 20px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.card h2 {
  font-size: 19px;
  margin: 0;
}
.card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.switch {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  white-space: nowrap;
}
.switch input {
  accent-color: var(--brand);
  width: 17px;
  height: 17px;
}
.map-wrap {
  position: relative;
  min-height: 560px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f4faf7, #eef4f0);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 12px;
}
.map-wrap svg {
  width: 100%;
  height: 100%;
  max-height: 690px;
  touch-action: manipulation;
}
.district {
  fill: var(--map);
  stroke: #fff;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition:
    fill 0.12s,
    filter 0.12s;
}
.district:focus {
  outline: none;
}
.district:focus-visible {
  fill: #bcd5c9;
}
.district.selected,
.district.selected:focus-visible {
  fill: var(--brand);
}
/* hover শুধু মাউস/ট্র্যাকপ্যাডে — মোবাইলে ট্যাপের পর রং আটকে থাকবে না */
@media (hover: hover) and (pointer: fine) {
  .district:hover {
    fill: #bcd5c9;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
  }
  .district.selected:hover {
    fill: var(--brand2);
  }
}
.map-label {
  font-size: 9px;
  font-weight: 700;
  fill: #20352b;
  pointer-events: none;
  text-anchor: middle;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 2px;
  stroke-linejoin: round;
}
.map-label.on-selected {
  fill: #fff;
  stroke: var(--brand);
  stroke-width: 2.4px;
}
.tooltip {
  position: absolute;
  background: #14251d;
  color: #fff;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12px;
  pointer-events: none;
  transform: translate(-50%, -125%);
  white-space: nowrap;
  z-index: 5;
}
.legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot.visited {
  background: var(--brand);
}
.dot.unvisited {
  background: var(--map);
  border: 1px solid #ccd7d0;
}
.picker-card {
  padding: 18px;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 108px);
  display: flex;
  flex-direction: column;
}
.picker-head > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.picker-head h2 {
  font-size: 18px;
  margin: 0;
}
.pill {
  font-size: 12px;
  color: var(--brand);
  background: var(--soft);
  font-weight: 700;
  border-radius: 99px;
  padding: 4px 9px;
}
.actions {
  display: flex;
  gap: 12px;
  margin: 10px 0;
}
.text-btn {
  color: var(--brand);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  padding: 0 12px;
  margin-bottom: 10px;
}
.search:focus-within {
  border-color: var(--brand);
}
.search span {
  font-size: 22px;
  color: var(--muted);
}
.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  padding: 10px 0;
}
.groups {
  overflow: auto;
  padding-right: 3px;
}
.group {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.group:first-child {
  border-top: 0;
}
.group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.group-title b {
  font-size: 13px;
}
.group-title small {
  color: var(--muted);
}
.group-title button {
  font: inherit;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 11px;
  cursor: pointer;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  font: inherit;
  font-size: 12px;
  border: 1px solid transparent;
  background: #f0f3f1;
  border-radius: 99px;
  padding: 7px 10px;
  cursor: pointer;
}
@media (hover: hover) {
  .chip:hover {
    border-color: #bdc9c2;
  }
}
.chip.selected {
  background: var(--brand);
  color: #fff;
}
.progress-card {
  margin-top: 20px;
  padding: 20px;
}
.division-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.dp {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.dp-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
}
.bar {
  height: 7px;
  background: #edf1ee;
  border-radius: 99px;
  margin-top: 9px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
}
.privacy {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 24px 0 40px;
}
footer {
  text-align: center;
  padding: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  background: #fff;
}
.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .picker-card {
    position: static;
    max-height: none;
  }
  .groups {
    overflow: visible;
  }
  .map-wrap {
    min-height: 500px;
  }
  .division-progress {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .shell {
    width: min(100% - 20px, 1180px);
  }
  .nav {
    height: 60px;
  }
  .brand {
    font-size: 15px;
  }
  .ghost {
    font-size: 12px;
    padding: 7px 9px;
  }
  .hero {
    padding: 34px 6px 24px;
  }
  .hero h1 {
    font-size: 35px;
  }
  .hero p {
    font-size: 15px;
  }
  .stats {
    gap: 7px;
  }
  .stats div {
    padding: 11px 6px;
    border-radius: 13px;
  }
  .stats strong {
    font-size: 21px;
  }
  .stats span {
    font-size: 11px;
  }
  .map-card,
  .picker-card,
  .progress-card {
    padding: 13px;
    border-radius: 16px;
  }
  .map-card .card-head {
    align-items: flex-start;
  }
  .map-wrap {
    min-height: 0;
    aspect-ratio: 7/9;
    padding: 4px;
  }
  .map-wrap svg {
    max-height: none;
  }
  .map-label {
    font-size: 10px;
  }
  .division-progress {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .dp {
    padding: 10px;
  }
  .chip {
    font-size: 13px;
    padding: 8px 11px;
  }
  .picker-card {
    order: 2;
  }
  .map-card {
    order: 1;
  }
  .workspace {
    gap: 12px;
  }
  .legend {
    margin-top: 6px;
  }
  .card-head p {
    max-width: 220px;
  }
  .switch {
    font-size: 12px;
  }
}
@media (max-width: 390px) {
  .hero h1 {
    font-size: 31px;
  }
  .stats span {
    font-size: 10px;
  }
  .division-progress {
    grid-template-columns: 1fr;
  }
  .brand span {
    font-size: 14px;
  }
}
.customize,
.extras,
.download-card {
  margin-top: 20px;
  padding: 20px;
}
.custom-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.custom-grid label,
.field-label {
  font-size: 13px;
  font-weight: 700;
}
.custom-grid input[type="text"],
#userName {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: var(--bg);
  outline: 0;
}
.custom-grid input:focus {
  border-color: var(--brand);
}
.themes {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.theme-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #fff;
  outline: 2px solid transparent;
  cursor: pointer;
}
.theme-dot.active {
  outline-color: var(--ink);
}
.photo-pick input {
  display: none;
}
.photo-pick span {
  display: block;
  margin-top: 6px;
  border: 1px dashed #bdc9c2;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ghost.small {
  height: 43px;
}
.achievements {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.badge {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 99px;
  padding: 7px 11px;
  font-size: 12px;
}
.badge.unlocked {
  background: var(--soft);
  border-color: #b8dccd;
  color: var(--brand);
  font-weight: 700;
}
.extra-actions,
.download-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  font: inherit;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--ink);
}
.btn.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.random-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--brand);
  font-weight: 700;
}
.export-note {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 0;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #14251d;
  color: #fff;
  padding: 10px 15px;
  border-radius: 99px;
  font-size: 13px;
  z-index: 99;
  box-shadow: var(--shadow);
}
@media (max-width: 900px) {
  .custom-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .customize,
  .extras,
  .download-card {
    padding: 13px;
    border-radius: 16px;
  }
  .custom-grid {
    grid-template-columns: 1fr;
  }
  .download-actions .btn,
  .extra-actions .btn {
    flex: 1 1 calc(50% - 10px);
    font-size: 12px;
  }
  .photo-pick span {
    white-space: normal;
  }
  .theme-dot {
    width: 32px;
    height: 32px;
  }
}
@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .shared-banner {
    display: none !important;
  }
  .top,
  .hero,
  .picker-card,
  .customize,
  .extras,
  .download-card,
  .privacy,
  footer,
  .legend,
  .switch {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .shell {
    width: 100%;
  }
  .stats {
    max-width: 700px;
  }
  .workspace {
    display: block;
  }
  .map-card,
  .progress-card,
  .stats div {
    box-shadow: none;
  }
  .map-wrap {
    min-height: 650px;
  }
  .progress-card {
    margin-top: 14px;
  }
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.chip:focus-visible,
.btn:focus-visible,
.text-btn:focus-visible,
.theme-dot:focus-visible,
.ghost:focus-visible,
.district:focus-visible {
  outline: 3px solid rgba(11, 107, 75, 0.35);
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 2px;
}
@media (max-width: 600px) {
  .extra-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .extra-actions .btn:first-child {
    grid-column: 1/-1;
  }
  .download-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .download-actions .btn {
    width: 100%;
  }
}

/* BackspaceX brand assets */
@font-face {
  font-family: "Nevan";
  src: url("../fonts/Nevan.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
.brand-word {
  font-family: "Nevan", system-ui, sans-serif;
  letter-spacing: 0.01em;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand > img {
  width: 38px;
  height: 38px;
  display: block;
}
.brand > span {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand > span b {
  font-size: 18px;
}
.brand > span small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}
.hero-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--brand);
}
.hero-brand img {
  width: 28px;
  height: 28px;
}
.hero-brand span {
  font-size: 20px;
}
.section-logo {
  width: 24px;
  height: 24px;
  vertical-align: -6px;
  margin-right: 5px;
}
footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
footer > img {
  width: 34px;
  height: 34px;
}
footer > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}
footer .brand-word {
  font-size: 17px;
  color: var(--ink);
}
footer div span {
  font-size: 12px;
}
@media (max-width: 600px) {
  .brand > img {
    width: 32px;
    height: 32px;
  }
  .brand > span b {
    font-size: 15px;
  }
  .brand > span small {
    font-size: 9px;
  }
  .hero-brand span {
    font-size: 18px;
  }
  footer {
    padding: 18px 12px;
  }
  footer > img {
    width: 30px;
    height: 30px;
  }
}

/* v1.5 */
[hidden] {
  display: none !important;
}
#labels {
  display: none;
}
#map.show-labels #labels {
  display: inline;
}
.map-label {
  font-family: "Noto Sans Bengali", "Nirmala UI", sans-serif;
}
.district.pulse {
  animation: pulse 1s ease-in-out 3;
}
@keyframes pulse {
  0%,
  100% {
    fill: var(--map);
  }
  50% {
    fill: var(--brand2);
  }
}
.shared-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--soft);
  border: 1px solid rgba(11, 107, 75, 0.3);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  color: var(--ink);
}
.shared-banner p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  flex: 1 1 320px;
}
.shared-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn.small {
  padding: 8px 12px;
  font-size: 13px;
}
body.is-viewing .district {
  cursor: default;
}
body.is-viewing .chip,
body.is-viewing #all,
body.is-viewing #none,
body.is-viewing .group-title button {
  opacity: 0.75;
}
@media (max-width: 600px) {
  .shared-actions {
    width: 100%;
  }
  .shared-actions .btn {
    flex: 1;
  }
}

/* v1.6: shared-view polish — viewer যেন নিজের customization-এর সঙ্গে shared map গুলিয়ে না ফেলেন */
body.is-viewing .customize { display: none; }


/* v1.8 — stable UX additions from v1.6 baseline */
.map-label { font-size: 12px; font-weight: 750; stroke-width: 2.5px; }
.map-label.on-selected { stroke-width: 3px; }
.map-head-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.icon-btn { width:40px; height:40px; border:1px solid var(--line); border-radius:12px; background:#fff; color:var(--ink); font:700 22px/1 sans-serif; cursor:pointer; display:inline-grid; place-items:center; }
.icon-btn:hover { background:var(--soft); border-color:var(--brand); }
.group-title button { min-width:74px; }
.map-card:fullscreen { background:var(--bg); padding:18px; display:flex; flex-direction:column; }
.map-card:fullscreen .map-wrap { flex:1; min-height:0; max-width:min(900px, 100%); width:100%; margin:auto; }
.map-card:fullscreen .map-wrap svg { max-height:none; }
.preview-modal { position:fixed; inset:0; z-index:1000; background:rgba(8,18,13,.72); padding:20px; overflow:auto; display:grid; place-items:center; }
.preview-modal[hidden] { display:none !important; }
.preview-dialog { width:min(620px, 100%); background:#fff; border-radius:20px; padding:18px; box-shadow:0 24px 80px rgba(0,0,0,.28); }
.preview-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:14px; }
.preview-head h2 { margin:0 0 3px; font-size:20px; }
.preview-head p { margin:0; color:var(--muted); font-size:13px; }
.preview-stage { background:#ece8de; border-radius:14px; padding:10px; display:grid; place-items:center; max-height:70vh; overflow:auto; }
.preview-stage img { display:block; width:auto; max-width:100%; max-height:66vh; border-radius:8px; box-shadow:0 4px 18px rgba(0,0,0,.12); }
.preview-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:14px; }
body.modal-open { overflow:hidden; }
@media (max-width:600px) {
  .map-label { font-size:12.5px; stroke-width:2.8px; }
  .map-head-actions { width:100%; justify-content:space-between; }
  .preview-modal { padding:10px; }
  .preview-dialog { padding:12px; border-radius:16px; }
  .preview-actions .btn { flex:1; }
}

/* v1.8.1 — ছোট স্ক্রিনে জেলার নাম (আগের ৩৯০px নিয়ম v1.8-এর পরের নিয়মে চাপা পড়ে যাচ্ছিল) */
@media (max-width: 390px) {
  .map-label { font-size: 11.5px; stroke-width: 2.6px; }
}

/* v1.8.1 — প্রিন্ট/PDF: এক পাতায়, শিরোনামসহ */
.print-title { display: none; }
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  .print-title { display: block; text-align: center; margin: 0 0 10px; }
  .print-title h1 { font-size: 24px; margin: 0; line-height: 1.3; }
  .print-title p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
  .icon-btn, #mapHint, .map-card .card-head { display: none !important; }
  .stats { margin-bottom: 10px; }
  .stats div { padding: 8px; }
  .map-card { padding: 8px; }
  .map-wrap { min-height: 0; height: 500px; padding: 0; }
  .map-wrap svg { max-height: 500px; }
  .workspace { margin: 0; }
  .division-progress { grid-template-columns: repeat(4, 1fr) !important; }
  .progress-card .card-head { margin-bottom: 6px; }
  .toast, .preview-modal, .tooltip { display: none !important; }
  .progress-card { padding: 12px; margin-top: 10px; }
  .division-progress { gap: 6px; }
  .dp { padding: 7px 9px; }
  .card, .dp, .stats { break-inside: avoid; page-break-inside: avoid; }
  .achievements { margin-top: 8px; }
}
