.tkm-page {
  --tkm-bg-a: #eff6ff;
  --tkm-bg-b: #eef9ff;
  --tkm-card: #ffffff;
  --tkm-border: rgba(15, 23, 42, 0.12);
  --tkm-shadow: 0 18px 42px rgba(2, 6, 23, 0.09);
  --tkm-text: #0f172a;
  --tkm-accent: #2563eb;
  --tkm-accent-deep: #1d4ed8;
  --tkm-marker: #db2777;
  --tkm-marker-deep: #be185d;
  --tkm-marker-light: #f472b6;
  --tkm-office-marker: #06b6d4;
  --tkm-office-marker-deep: #0891b2;

  display: flex;
  flex-direction: column;
  gap: 18px;
  color: var(--tkm-text);
  background: transparent;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
}

.tkm-hidden {
  display: none !important;
}

.tkm-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid #e6e8ef;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.04);
}

.tkm-hero-copy {
  flex: 1;
  min-width: 0;
}

.tkm-hero-title {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  color: #101828;
}

.tkm-hero-subtitle {
  margin: 0;
  max-width: 860px;
  font-size: 15px;
  line-height: 1.65;
  color: #475467;
}

.tkm-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  perspective: 1200px;
  align-items: stretch;
}

.tkm-module-card {
  --module-accent: #2563eb;
  --module-accent-soft: rgba(37, 99, 235, 0.2);
  appearance: none;
  border: 1px solid #d9e2f1;
  border-radius: 18px;
  background:
    radial-gradient(140% 120% at 100% 0%, var(--module-accent-soft), transparent 62%),
    linear-gradient(165deg, #ffffff 0%, #f8fbff 60%, #edf4ff 100%);
  text-align: left;
  padding: 20px 20px 22px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 180px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transform-style: preserve-3d;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease;
  box-shadow:
    0 16px 30px rgba(15, 23, 42, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.tkm-module-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  right: -44px;
  top: -68px;
  background: radial-gradient(circle, var(--module-accent-soft) 0%, rgba(255, 255, 255, 0) 72%);
}

.tkm-module-card::after {
  content: "";
  position: absolute;
  inset: auto 12px 12px 12px;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(148, 163, 184, 0.45),
    rgba(255, 255, 255, 0)
  );
}

.tkm-module-card:hover {
  transform: translateY(-6px) rotateX(2deg);
  border-color: #b7c8e6;
  box-shadow:
    0 26px 40px rgba(15, 23, 42, 0.14),
    0 8px 18px rgba(15, 23, 42, 0.08);
}

.tkm-module-card:active {
  transform: translateY(-3px) rotateX(1deg);
}

.tkm-module-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--module-accent);
}

.tkm-module-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.tkm-module-text {
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
}

.tkm-module-card:nth-child(1) {
  --module-accent: #2563eb;
  --module-accent-soft: rgba(37, 99, 235, 0.22);
}

.tkm-module-card:nth-child(2) {
  --module-accent: #0f766e;
  --module-accent-soft: rgba(15, 118, 110, 0.22);
}

.tkm-module-card:nth-child(3) {
  --module-accent: #15803d;
  --module-accent-soft: rgba(21, 128, 61, 0.22);
}

.tkm-module-card:nth-child(4) {
  --module-accent: #dc2626;
  --module-accent-soft: rgba(220, 38, 38, 0.2);
}

.tkm-module-card:nth-child(5) {
  --module-accent: #b45309;
  --module-accent-soft: rgba(180, 83, 9, 0.24);
}

.tkm-module-card-placeholder {
  cursor: default;
}

.tkm-module-card-placeholder:disabled {
  opacity: 1;
}

.tkm-workspace {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
  box-shadow: none;
}

.tkm-workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.tkm-workspace-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #667085;
  margin-bottom: 8px;
}

.tkm-workspace-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  color: #101828;
}

.tkm-workspace-subtitle {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #475467;
}

.tkm-back-btn {
  appearance: none;
  border: 1px solid #b42318;
  background: linear-gradient(180deg, #ef4444 0%, #b42318 100%);
  color: #fff;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    transform 0.14s ease,
    box-shadow 0.18s ease,
    filter 0.14s ease;
  box-shadow: 0 6px 14px rgba(180, 35, 24, 0.3);
}

.tkm-back-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
  box-shadow: 0 8px 16px rgba(180, 35, 24, 0.34);
}

.tkm-map-tool-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  color: var(--tkm-text);
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--tkm-border);
  box-shadow: var(--tkm-shadow);
  padding: 14px;
  overflow: hidden;
}

.tkm-head {
  display: flex;
  flex-direction: column;
}

.tkm-title {
  margin: 0;
  font-size: 27px;
  font-weight: 850;
  letter-spacing: 0.01em;
}

.tkm-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 13px;
  padding: 8px 10px;
  backdrop-filter: blur(4px);
}

.tkm-toolbar-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tkm-toolbar-row-main {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(200px, 0.8fr) minmax(220px, 1fr);
  align-items: center;
  gap: 10px;
}

.tkm-action-group {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  justify-self: start;
}

.tkm-btn {
  min-height: 36px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: #fff;
  color: #0f172a;
  border-radius: 10px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition:
    transform 0.14s ease,
    filter 0.14s ease,
    box-shadow 0.2s ease;
}

.tkm-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.99);
  box-shadow: 0 5px 11px rgba(15, 23, 42, 0.14);
}

.tkm-btn:disabled {
  cursor: default;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.tkm-btn-primary {
  border-color: rgba(22, 163, 74, 0.84);
  color: #fff;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 6px 14px rgba(22, 163, 74, 0.24);
}

.tkm-btn-cached {
  border-color: rgba(194, 65, 12, 0.82);
  color: #fff;
  background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
  box-shadow: 0 6px 14px rgba(194, 65, 12, 0.26);
}

.tkm-btn-export {
  border-color: rgba(37, 99, 235, 0.82);
  color: #fff;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
}

.tkm-file-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(194, 65, 12, 0.82);
  background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    filter 0.14s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 6px 14px rgba(194, 65, 12, 0.26);
}

.tkm-file-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.99);
}

.tkm-file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

#tkmLoadBtn {
  order: 1;
}

#tkmExportBtn {
  order: 2;
}

#tkmImportWrap {
  order: 3;
}

.tkm-status {
  min-height: 18px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  justify-self: center;
  text-align: center;
}

.tkm-status.is-error {
  color: #b91c1c;
}

.tkm-summary {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
}

.tkm-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(15, 23, 42, 0.11);
  background: rgba(15, 23, 42, 0.04);
}

.tkm-pill strong {
  color: #0f172a;
}

.tkm-map-card {
  position: relative;
  background: transparent;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.tkm-map {
  height: min(74vh, 860px);
  min-height: 540px;
  border-radius: 13px;
  border: 1px solid var(--tkm-border);
}

.tkm-map .leaflet-control-zoom a {
  font-weight: 700;
}

.tkm-map .leaflet-popup-content-wrapper {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.15);
}

.tkm-popup {
  min-width: 176px;
  color: #0f172a;
}

.tkm-popup-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
}

.tkm-popup-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 7px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(217, 119, 6, 0.34);
  background: rgba(254, 243, 199, 0.92);
  color: #92400e;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.tkm-popup-title-badge strong {
  font-weight: 800;
}

.tkm-popup-title-value {
  font-weight: 500;
}

.tkm-popup-sub {
  margin: 0;
  color: rgba(15, 23, 42, 0.75);
  font-size: 12px;
}

.tkm-popup-sub-accent {
  display: inline-flex;
  align-items: center;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 7px;
  color: #1e40af;
  font-weight: 800;
  font-size: 12.5px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(219, 234, 254, 0.88);
}

.tkm-popup-meta {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.9);
  line-height: 1.42;
}

.tkm-map .leaflet-popup-close-button {
  top: 7px !important;
  right: 7px !important;
  width: 26px !important;
  height: 26px !important;
  padding: 0 !important;
  box-sizing: border-box;
  border-radius: 8px;
  display: grid !important;
  place-items: center;
  text-align: center;
  font-size: 0 !important;
  line-height: 1 !important;
  font-weight: 700;
  color: #1e40af !important;
  background: rgba(219, 234, 254, 0.82);
  border: 1px solid rgba(96, 165, 250, 0.32);
  transition:
    transform 0.14s ease,
    background 0.18s ease,
    box-shadow 0.2s ease,
    color 0.18s ease;
}

.tkm-map .leaflet-popup-close-button::before {
  content: "×";
  display: block;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-1px);
}

.tkm-map .leaflet-popup-close-button:hover {
  transform: translateY(-1px);
  color: #ffffff !important;
  background: #f35454;
  border-color: #ce3d3d;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.tkm-map .leaflet-popup-close-button:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 1px;
}

.tkm-country-outline,
.tkm-outside-mask {
  pointer-events: none;
}

.tkm-school-marker {
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
}

.tkm-school-marker .tkm-marker-core {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: linear-gradient(
    180deg,
    var(--tkm-marker-light) 0%,
    var(--tkm-marker) 64%,
    var(--tkm-marker-deep) 100%
  );
  border: 1px solid rgba(190, 24, 93, 0.72);
  box-shadow:
    0 5px 10px rgba(190, 24, 93, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.68);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(45deg);
  transition:
    transform 0.14s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.tkm-school-marker svg {
  width: 12px;
  height: 12px;
  transform: rotate(-45deg);
}

.tkm-school-marker.is-office .tkm-marker-core {
  background: linear-gradient(
    180deg,
    #67e8f9 0%,
    var(--tkm-office-marker) 62%,
    var(--tkm-office-marker-deep) 100%
  );
  border-color: rgba(8, 145, 178, 0.74);
  box-shadow:
    0 5px 10px rgba(8, 145, 178, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.68);
}

.tkm-school-marker.is-hover .tkm-marker-core,
.tkm-school-marker:hover .tkm-marker-core {
  transform: rotate(45deg) scale(1.08);
  filter: saturate(1.08);
  box-shadow:
    0 8px 14px rgba(190, 24, 93, 0.44),
    0 0 0 2px rgba(255, 255, 255, 0.76);
}

.tkm-school-marker.is-focus .tkm-marker-core {
  box-shadow:
    0 0 0 3px rgba(190, 24, 93, 0.28),
    0 8px 14px rgba(190, 24, 93, 0.45),
    0 0 16px rgba(190, 24, 93, 0.42);
  transform: rotate(45deg) scale(1.12);
}

.tkm-school-marker.is-office.is-hover .tkm-marker-core,
.tkm-school-marker.is-office:hover .tkm-marker-core {
  box-shadow:
    0 8px 14px rgba(8, 145, 178, 0.44),
    0 0 0 2px rgba(255, 255, 255, 0.76);
}

.tkm-school-marker.is-office.is-focus .tkm-marker-core {
  box-shadow:
    0 0 0 3px rgba(8, 145, 178, 0.28),
    0 8px 14px rgba(8, 145, 178, 0.45),
    0 0 16px rgba(8, 145, 178, 0.4);
  transform: rotate(45deg) scale(1.12);
}

.tkm-cluster {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.tkm-cluster-candidate {
  background: linear-gradient(180deg, rgba(244, 114, 182, 0.98), rgba(236, 72, 153, 0.95));
  border: 1px solid rgba(190, 24, 93, 0.74);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.75),
    0 0 11px rgba(190, 24, 93, 0.44),
    0 7px 13px rgba(157, 23, 77, 0.38);
}

.tkm-cluster-office {
  background: linear-gradient(180deg, rgba(103, 232, 249, 0.98), rgba(6, 182, 212, 0.95));
  border: 1px solid rgba(8, 145, 178, 0.74);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.75),
    0 0 11px rgba(8, 145, 178, 0.44),
    0 7px 13px rgba(14, 116, 144, 0.38);
}

.tkm-cluster span {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: translateY(-0.5px);
}

.tkm-fullscreen-btn {
  width: 42px !important;
  height: 42px !important;
  line-height: 42px !important;
  padding: 0 !important;
  border-radius: 10px;
  border: 1px solid rgba(29, 78, 216, 0.68);
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.96), rgba(37, 99, 235, 0.95));
  color: #fff;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.8),
    0 0 14px rgba(37, 99, 235, 0.5),
    0 7px 12px rgba(30, 64, 175, 0.42);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.tkm-fullscreen-btn:hover {
  transform: translateY(-1px) scale(1.03);
}

.tkm-fullscreen-btn svg {
  width: 34px !important;
  height: 34px !important;
  display: block;
}

.leaflet-bar .tkm-fullscreen-btn {
  width: 42px !important;
  height: 42px !important;
  line-height: 42px !important;
  padding: 0 !important;
}

.tkm-map-card:fullscreen {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.tkm-map-card:fullscreen .tkm-map {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  border: 0;
  border-radius: 0;
}

.tkm-map-card:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.tkm-map-card:-webkit-full-screen .tkm-map {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
}

.tkm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(15, 23, 42, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.tkm-modal-card {
  width: min(560px, 100%);
  border-radius: 14px;
  border: 1px solid #d5e0ef;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.25);
  padding: 16px;
}

.tkm-modal-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.tkm-modal-subtitle {
  margin: 0 0 12px;
  font-size: 13px;
  color: #475569;
}

.tkm-modal-choice {
  display: grid;
  gap: 8px;
}

.tkm-modal-choice-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tkm-modal-choice-btn {
  width: 100%;
  text-align: left;
  min-height: 42px;
}

.tkm-cache-hint {
  font-size: 12px;
  font-weight: 800;
  color: #b91c1c;
  white-space: nowrap;
}

.tkm-modal-progress {
  margin-top: 6px;
}

.tkm-progress {
  width: 100%;
}

.tkm-progress-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #dce5f5;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.14);
}

.tkm-progress-bar {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background-image: linear-gradient(90deg, #dc2626 0%, #f97316 26%, #f59e0b 44%, #84cc16 68%, #22c55e 100%);
  background-size: calc(10000% / var(--tkm-progress-percent, 100)) 100%;
  background-position: left top;
  background-repeat: no-repeat;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.25);
  transition:
    width 0.25s ease,
    background-size 0.24s ease,
    box-shadow 0.24s ease;
}

.tkm-progress-bar.is-success {
  background-image: none;
  background-color: #22c55e;
  box-shadow:
    0 0 22px rgba(34, 197, 94, 0.52),
    0 0 38px rgba(34, 197, 94, 0.3),
    0 0 54px rgba(134, 239, 172, 0.22);
}

.tkm-progress-text {
  margin-top: 8px;
  font-size: 13px;
  color: #2f4a3d;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tkm-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: tkm-spin 0.8s linear infinite;
}

.tkm-modal-error {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #b91c1c;
}

.tkm-modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.is-hidden {
  display: none !important;
}

@keyframes tkm-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .tkm-hero {
    flex-direction: column;
  }

  .tkm-workspace-head {
    flex-direction: column;
  }

  .tkm-workspace {
    padding: 16px;
  }
}

@media (max-width: 1000px) {
  .tkm-toolbar-row-main {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .tkm-action-group,
  .tkm-status,
  .tkm-summary {
    justify-self: stretch;
  }

  .tkm-status,
  .tkm-summary {
    text-align: left;
    justify-content: flex-start;
  }

  .tkm-map {
    min-height: 500px;
    height: 66vh;
  }
}

@media (max-width: 760px) {
  .tkm-title {
    font-size: 23px;
  }

  .tkm-map {
    min-height: 460px;
    height: 62vh;
  }
}

@media (max-width: 560px) {
  .tkm-action-group {
    width: 100%;
  }

  .tkm-btn,
  .tkm-file-btn {
    width: 100%;
    justify-content: center;
  }
}
