:root {
  --blue-950: #082f63;
  --blue-900: #123f7c;
  --blue-800: #174a8b;
  --blue-700: #1f5aa8;
  --blue-600: #2563b8;
  --blue-50: #eef6ff;

  --gold: #f4a51c;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;

  --border: #d8e2ee;
  --border-strong: #b8c7d9;

  --text: #1f2937;
  --text-strong: #111827;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --danger: #c62828;
  --success: #15803d;

  --shadow-sm: 0 2px 8px rgba(15, 35, 55, 0.08);
  --shadow: 0 10px 30px rgba(15, 35, 55, 0.16);

  --header-h: 64px;
  --footer-h: 30px;
  --left-w: 390px;
  --right-w: 330px;

  --radius: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.webgis-shell {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app-header {
  height: var(--header-h);
  flex-shrink: 0;
  background: var(--blue-900);
  color: #fff;
  border-bottom: 3px solid var(--gold);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  box-shadow: var(--shadow-sm);
  z-index: 1200;
}

.brand-area {
  min-width: 345px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fff;
  color: var(--blue-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.agency-name {
  font-size: 12px;
  line-height: 1.15;
  letter-spacing: 0.055em;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  text-transform: uppercase;
}

.brand-text h1 {
  font-size: 20px;
  line-height: 1.15;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-top: 3px;
}

.main-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.nav-item {
  height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  transition: 0.15s ease;
  white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.nav-item i {
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.lang-btn {
  width: 38px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 5px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.lang-btn.active {
  background: #fff;
  color: var(--blue-900);
}

.admin-link {
  height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.app-main {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
}

.left-panel {
  width: var(--left-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 650;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.22s ease;
}

.left-panel.collapsed {
  margin-left: calc(-1 * var(--left-w));
}

.panel-header {
  height: 82px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  flex-shrink: 0;
}

.panel-eyebrow {
  color: var(--blue-800);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.panel-header h2 {
  margin-top: 3px;
  color: var(--text-strong);
  font-size: 21px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.collapse-btn,
.open-left-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue-800);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collapse-btn:hover,
.open-left-btn:hover {
  background: var(--blue-50);
}

.open-left-btn {
  position: absolute;
  left: 12px;
  top: 92px;
  z-index: 780;
  box-shadow: var(--shadow-sm);
}

.content-panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px;
  background: #fff;
}

.content-panel.active {
  display: block;
}

.content-panel::-webkit-scrollbar,
.right-drawer::-webkit-scrollbar {
  width: 8px;
}

.content-panel::-webkit-scrollbar-thumb,
.right-drawer::-webkit-scrollbar-thumb {
  background: #c5d2e2;
  border-radius: 999px;
}

.intro-card {
  background: var(--blue-50);
  border: 1px solid #cfe2f8;
  border-left: 4px solid var(--blue-800);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.intro-card h3 {
  color: var(--blue-900);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.intro-card p {
  color: #41546d;
  font-size: 14px;
  line-height: 1.65;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin-bottom: 18px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 15px 8px;
  text-align: center;
}

.stat-card strong {
  display: block;
  color: var(--blue-700);
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.stat-card span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  margin: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--blue-900);
  font-size: 16px;
  font-weight: 900;
}

.section-title i {
  color: var(--blue-800);
}

.place-list,
.route-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.place-card {
  display: flex;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  overflow: hidden;
  transition: 0.15s ease;
}

.place-card:hover {
  border-color: var(--blue-600);
  box-shadow: var(--shadow-sm);
}

.place-thumb {
  width: 96px;
  height: 82px;
  object-fit: cover;
  border-radius: 6px;
  background: #e2e8f0;
  flex-shrink: 0;
}

.place-info {
  flex: 1;
  min-width: 0;
}

.place-name {
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: 6px;
}

.place-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: #31445b;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
}

.place-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  margin-top: 9px;
  display: flex;
  gap: 7px;
}

.mini-btn {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue-800);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mini-btn:hover {
  background: var(--blue-50);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  border-radius: 7px;
  outline: 0;
  padding: 11px 12px;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 184, 0.13);
}

.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.custom-select-ui {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-select-btn {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  border-radius: 7px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
}

.custom-select-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-btn i {
  color: var(--blue-800);
  font-size: 12px;
  flex: 0 0 auto;
  transition: transform 0.16s ease;
}

.custom-select-ui.open .custom-select-btn,
.custom-select-btn:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 184, 0.13);
}

.custom-select-ui.open .custom-select-btn i {
  transform: rotate(180deg);
}

.custom-select-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 260px;
  overflow-y: auto;
  z-index: 5000;
  border: 1px solid #cfe2f8;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(8, 47, 99, 0.16);
  padding: 6px;
}

.custom-select-ui.open .custom-select-menu {
  display: grid;
  gap: 3px;
}

.custom-select-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  padding: 10px 11px;
  text-align: left;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
}

.custom-select-menu button:hover {
  background: var(--blue-50);
  color: var(--blue-900);
}

.custom-select-menu button.active {
  background: var(--blue-700);
  color: #fff;
  font-weight: 800;
}

.search-box {
  height: 44px;
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  margin-bottom: 10px;
}

.search-box i {
  color: var(--blue-800);
  font-size: 15px;
}

.search-box input {
  border: 0;
  outline: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  color: var(--text);
  font-size: 14px;
}

.suggest-box {
  display: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.suggest-box.show {
  display: block;
}

.suggest-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.suggest-item:last-child {
  border-bottom: 0;
}

.suggest-item:hover {
  background: var(--blue-50);
}

.btn {
  min-height: 39px;
  border-radius: 7px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.btn.primary {
  border: 1px solid var(--blue-700);
  background: var(--blue-700);
  color: #fff;
}

.btn.primary:hover {
  background: var(--blue-900);
}

.btn.secondary {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--blue-800);
}

.btn.secondary:hover {
  background: var(--blue-50);
}

.btn.full {
  width: 100%;
}

.direction-current-btn {
  margin: -3px 0 10px;
  border-color: #cfe2f8 !important;
  background: #f8fbff !important;
  color: #174a8b !important;
}

.direction-current-btn.loading {
  pointer-events: none;
  opacity: 0.78;
}

.direction-current-btn.loading i {
  animation: spin 0.8s linear infinite;
}

.direction-inline-status {
  margin: -2px 0 12px;
  border: 1px solid #cfe2f8;
  background: #f8fbff;
  color: #174a8b;
  border-radius: 7px;
  padding: 10px 11px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 700;
}

.direction-inline-status.hidden {
  display: none;
}

.direction-inline-status i {
  margin-top: 2px;
  flex: 0 0 auto;
}

.direction-inline-status.loading i {
  animation: spin 0.8s linear infinite;
}

.direction-inline-status.success {
  border-color: rgba(21, 128, 61, 0.2);
  background: rgba(21, 128, 61, 0.06);
  color: #166534;
}

.direction-inline-status.error {
  border-color: rgba(198, 40, 40, 0.22);
  background: rgba(198, 40, 40, 0.06);
  color: #991b1b;
}

.panel-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.filter-result-count {
  margin: -4px 0 12px;
  color: #52647b;
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 800;
}

.filter-result-count strong {
  color: #082f63;
}

.route-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: 0.15s ease;
}

.route-card:hover,
.route-card.active {
  border-color: var(--blue-600);
  box-shadow: var(--shadow-sm);
}

.route-main {
  display: flex;
  gap: 11px;
  padding: 13px;
}

.route-color {
  width: 5px;
  border-radius: 999px;
  flex-shrink: 0;
}

.route-info {
  flex: 1;
  min-width: 0;
}

.route-name {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.route-name i {
  color: var(--blue-800);
  margin-right: 4px;
}

.route-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.route-foot {
  margin-top: 9px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.route-count {
  color: var(--blue-800);
  font-weight: 900;
}

.timeline-box {
  margin-top: 16px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.route-timeline {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.timeline-item {
  display: flex;
  gap: 10px;
  cursor: pointer;
}

.timeline-num {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--blue-700);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-line {
  width: 25px;
  display: flex;
  justify-content: center;
}

.timeline-line::after {
  content: "";
  width: 2px;
  min-height: 24px;
  background: var(--border);
}

.timeline-content {
  min-width: 0;
  padding-bottom: 12px;
}

.timeline-title {
  font-size: 13px;
  color: var(--text-strong);
  font-weight: 700;
}

.timeline-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.select-with-badge {
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px 1fr 32px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #fff;
  padding: 5px 7px;
}

.select-with-badge select {
  border: 0;
  box-shadow: none;
  padding: 7px 4px;
}

.select-with-badge .custom-select-ui {
  min-width: 0;
}

.select-with-badge .custom-select-btn {
  min-height: 34px;
  border: 0;
  box-shadow: none !important;
  padding: 0 4px;
}

.select-with-badge .custom-select-menu {
  left: -35px;
  right: -39px;
  top: calc(100% + 12px);
}

.point-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
}

.point-badge.start {
  background: var(--success);
}

.point-badge.end {
  background: var(--danger);
}

.clear-point {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 5px;
}

.clear-point:hover {
  background: var(--blue-50);
  color: var(--blue-800);
}

.swap-row {
  display: flex;
  justify-content: flex-end;
  margin: -7px 0 8px;
}

.swap-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue-800);
  border-radius: 7px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.mode-card {
  min-height: 58px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.mode-card input {
  display: none;
}

.mode-card i {
  font-size: 16px;
}

.mode-card.active {
  border-color: var(--blue-700);
  background: var(--blue-50);
  color: var(--blue-800);
}

.direction-result {
  display: none;
  margin-top: 14px;
  border: 1px solid #cfe2f8;
  background: var(--blue-50);
  border-radius: 8px;
  overflow: hidden;
}

.direction-result.show {
  display: block;
}

.direction-summary {
  padding: 13px 14px;
}

.direction-summary b {
  display: block;
  color: var(--text-strong);
  font-size: 15px;
  margin-bottom: 7px;
}

.direction-summary .places {
  color: #334155;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 12px;
}

.direction-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid #d5e7fa;
}

.direction-metric {
  padding: 11px 13px;
}

.direction-metric+.direction-metric {
  border-left: 1px solid #d5e7fa;
}

.direction-metric label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.direction-metric strong {
  display: block;
  margin-top: 4px;
  color: var(--blue-800);
  font-size: 20px;
  font-weight: 900;
}

.steps-list {
  border-top: 1px solid #d5e7fa;
  background: #fff;
}

.steps-title {
  padding: 10px 13px;
  color: var(--blue-900);
  font-size: 13px;
  font-weight: 900;
  border-bottom: 1px solid var(--border);
}

.step-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--border);
  color: #334155;
  font-size: 13px;
}

.step-item:last-child {
  border-bottom: 0;
}

.step-item i {
  color: var(--blue-800);
}

.step-distance {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.direction-link {
  display: block;
  padding: 10px 13px;
  border-top: 1px solid var(--border);
  color: var(--blue-800);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  background: #fff;
}

.direction-link:hover {
  background: var(--blue-50);
}

.feedback-form {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.feedback-honeypot {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.feedback-form button[disabled],
.feedback-form .is-disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.about-list {
  margin-left: 18px;
  color: #334155;
  font-size: 14px;
  line-height: 1.8;
}

.map-area {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #dce6f0;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.map-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 600;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.map-toolbar button {
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--blue-900);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 900;
}

.map-toolbar button:hover {
  background: var(--blue-50);
}

.right-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--right-w);
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 850;
  transform: translateX(105%);
  transition: transform 0.22s ease;
  overflow-y: auto;
}

.right-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  height: 84px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-eyebrow {
  color: var(--blue-800);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.drawer-header h3 {
  margin-top: 4px;
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
}

.drawer-header button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue-800);
  border-radius: 7px;
}

.drawer-section {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.drawer-section h4 {
  color: var(--blue-900);
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 11px;
}

.check-row,
.radio-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
}

.check-row input,
.radio-row input {
  accent-color: var(--blue-800);
}

.legend-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #334155;
  font-size: 14px;
}

.legend-symbol {
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 35, 55, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.legend-symbol i {
  transform: rotate(45deg);
  color: #fff;
  font-size: 11px;
}

.legend-row span:last-child {
  flex: 1;
}

.north-arrow {
  position: absolute;
  right: 16px;
  bottom: 42px;
  z-index: 610;
  width: 44px;
  height: 58px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--blue-900);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.north-arrow span {
  font-size: 11px;
  font-weight: 900;
}

.north-arrow i {
  font-size: 20px;
  transform: rotate(-45deg);
}

.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 2200;
  background: rgba(245, 247, 251, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--blue-900);
  font-weight: 900;
}

.loading-overlay.hide {
  display: none;
}

.loader {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  border: 3px solid rgba(31, 90, 168, 0.18);
  border-top-color: var(--blue-700);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.app-footer {
  height: var(--footer-h);
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 12px;
  z-index: 900;
}

.toast {
  display: none;
  position: fixed;
  right: 18px;
  top: 82px;
  z-index: 6000;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue-700);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.toast.show {
  display: block;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 7000;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 40px;
  height: 40px;
  border: 0;
  background: #fff;
  color: var(--blue-900);
  border-radius: 50%;
}

.empty-state {
  padding: 17px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* Leaflet */
.leaflet-container {
  font-family: Arial, Helvetica, sans-serif !important;
}

.leaflet-control-zoom {
  margin-top: 64px !important;
  margin-left: 14px !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
}

.leaflet-control-zoom a {
  color: var(--text-strong) !important;
  font-weight: 900 !important;
}

/* Attribution */
.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.92) !important;
  padding: 2px 6px !important;
  font-size: 11px !important;
  color: #555 !important;
  border-radius: 4px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18) !important;
}

.leaflet-brand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #555 !important;
  text-decoration: none !important;
  font-weight: 500;
}

.leaflet-mini-logo {
  width: 13px;
  height: 9px;
  display: inline-flex;
  flex-direction: column;
  border: 1px solid #d6dce8;
  box-sizing: border-box;
}

.leaflet-mini-logo-blue {
  flex: 1;
  background: #2f6db7;
}

.leaflet-mini-logo-yellow {
  flex: 1;
  background: #f3d34a;
}

.leaflet-control-attribution a {
  color: #555 !important;
  text-decoration: none !important;
}

.leaflet-popup-content-wrapper {
  padding: 0 !important;
  border-radius: 9px !important;
  overflow: hidden !important;
  box-shadow: var(--shadow) !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 310px !important;
}

.leaflet-popup-tip {
  background: #fff !important;
}

.custom-marker {
  width: 30px;
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.marker-pin {
  width: 27px;
  height: 27px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.26);
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-pin i {
  transform: rotate(45deg);
  color: #fff;
  font-size: 11.5px;
}

.custom-marker.active .marker-pin {
  box-shadow: 0 0 0 6px rgba(31, 90, 168, 0.18), 0 4px 11px rgba(0, 0, 0, 0.28);
}

.ab-marker {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  color: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
}

.road-label {
  background: #1656b8;
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
}

.road-label-yellow {
  background: #f2b51e;
  color: #1f2937;
}

/* Popup */
.popup-card {
  background: #fff;
  color: var(--text);
  max-height: 72vh;
  overflow-y: auto;
}

.popup-img-wrap {
  width: 100%;
  height: 138px;
  background: #e2e8f0;
  overflow: hidden;
}

.popup-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.popup-body {
  padding: 12px 13px 13px;
}

.popup-title {
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.22;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 9px;
}

.popup-desc {
  color: #52647b;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 10px;
}

.popup-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 12px;
}

.popup-info div {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.popup-info i {
  color: #263442;
  margin-top: 2px;
  width: 14px;
  text-align: center;
}

.popup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.popup-btn {
  min-height: 36px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue-800);
  border-radius: 7px;
  padding: 0 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.popup-btn.primary {
  background: var(--blue-700);
  border-color: var(--blue-700);
  color: #fff;
}

.popup-btn:hover {
  background: var(--blue-50);
}

.popup-btn.primary:hover {
  background: var(--blue-900);
}

.popup-video-note {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* Responsive */
@media (max-width: 1200px) {
  .brand-area {
    min-width: 300px;
  }

  .brand-text h1 {
    font-size: 18px;
  }

  .nav-item {
    padding: 0 9px;
  }
}

@media (max-width: 1040px) {
  .nav-item span {
    display: none;
  }

  .nav-item {
    width: 42px;
    padding: 0;
    justify-content: center;
  }
}

@media (max-width: 860px) {

  html,
  body {
    overflow: auto;
  }

  .webgis-shell {
    height: auto;
    min-height: 100vh;
  }

  .app-header {
    height: auto;
    min-height: var(--header-h);
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .brand-area {
    min-width: 100%;
  }

  .main-nav {
    width: 100%;
    order: 3;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .nav-item span {
    display: inline;
  }

  .nav-item {
    width: auto;
    padding: 0 10px;
  }

  .app-main {
    flex-direction: column;
    height: auto;
  }

  .left-panel {
    width: 100%;
    height: 43vh;
    min-height: 360px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .left-panel.collapsed {
    margin-left: 0;
    display: none;
  }

  .map-area {
    height: 57vh;
    min-height: 430px;
  }

  .right-drawer {
    width: min(92vw, var(--right-w));
  }

  .app-footer {
    height: auto;
    min-height: var(--footer-h);
    padding: 7px 12px;
    flex-wrap: wrap;
    gap: 4px;
  }
}

@media (max-width: 560px) {
  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .place-card {
    flex-direction: column;
  }

  .place-thumb {
    width: 100%;
    height: 150px;
  }

  .map-toolbar button span {
    display: none;
  }

  .popup-actions {
    grid-template-columns: 1fr;
  }
}

/* ===== FINAL PATCH: right layer tab, Esri basemap UI, no overlap ===== */
.right-tab-btn {
  position: absolute;
  right: 14px;
  top: 92px;
  z-index: 780;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-900);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.right-tab-btn:hover {
  background: var(--blue-50);
}

.right-drawer.open~.north-arrow {
  display: none;
}

.north-arrow {
  right: 18px;
  bottom: 56px;
}

.leaflet-control-attribution {
  margin-right: 72px !important;
}

.popup-actions {
  grid-template-columns: 1fr 1fr;
}

.popup-actions .popup-btn:last-child:nth-child(odd) {
  grid-column: span 2;
}


/* ===== V65 FINAL HOTFIX: layout, drawer, modes, boundary legend ===== */

/* KhÃ´ng dÃ¹ng font web ngoÃ i Ä‘á»ƒ trÃ¡nh lá»—i font khi offline */
body,
button,
input,
select,
textarea,
.leaflet-container {
  font-family: Arial, Helvetica, sans-serif !important;
}

/* áº¨n nÃºt lá»›p dá»¯ liá»‡u trÃªn toolbar náº¿u cÃ²n sÃ³t tá»« báº£n cÅ© */
#btnOpenLayerPanel {
  display: none !important;
}

/* Cá»¥m nÃºt má»Ÿ panel bÃªn pháº£i */
.right-tab-stack {
  position: absolute;
  right: 14px;
  top: 92px;
  z-index: 780;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.right-tab-stack .right-tab-btn {
  position: static !important;
}

.right-tab-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-900);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.right-tab-btn:hover {
  background: var(--blue-50);
}

/* Drawer tab tÃ¡ch lá»›p dá»¯ liá»‡u vÃ  chÃº giáº£i */
.drawer-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.drawer-tab {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--blue-900);
  font-weight: 700;
  font-size: 13px;
}

.drawer-tab.active {
  background: var(--blue-900);
  border-color: var(--blue-900);
  color: #fff;
}

.drawer-panel {
  display: none;
}

.drawer-panel.active {
  display: block;
}

.line-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #334155;
  font-size: 14px;
}

.line-legend div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.line-sample {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 0;
  border-top: 4px solid #1f5aa8;
  border-radius: 999px;
}

.line-sample.route {
  height: 8px;
  border-top: 0;
}

.line-sample.route::before,
.line-sample.route::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-radius: 999px;
  transform: translateY(-50%);
}

.line-sample.route::before {
  height: 7px;
  background: #ffffff;
  box-shadow: 0 0 0 1px #c7d7eb;
}

.line-sample.route::after {
  height: 4px;
  background: #174a8b;
}

.line-sample.direction {
  border-top-color: #1d5fd1;
}

.line-sample.boundary {
  border-top: 3px solid #123f7c;
}

/* Sá»­a icon phÆ°Æ¡ng tiá»‡n bá»‹ lá»‡ch */
.mode-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.mode-card {
  position: relative;
  min-height: 56px !important;
  padding: 8px 6px;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  text-align: center;
  line-height: 1.2;
}

.mode-card input {
  display: none !important;
}

.mode-card i {
  position: static !important;
  display: inline-block !important;
  width: 18px;
  margin: 0 !important;
  font-size: 15px !important;
  line-height: 1 !important;
}

.mode-card span {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
}

/* Gá»n popup trÃ¡nh che giao diá»‡n quÃ¡ nhiá»u */
.leaflet-popup-content {
  width: 300px !important;
}

.popup-card {
  max-height: 66vh !important;
}

.popup-img-wrap {
  height: 120px !important;
}

.popup-actions {
  grid-template-columns: 1fr 1fr !important;
}

/* Khi drawer má»Ÿ, áº©n mÅ©i tÃªn báº¯c trÃ¡nh Ä‘Ã¨ */
.right-drawer.open~.north-arrow {
  display: none;
}

.leaflet-control-attribution {
  margin-right: 72px !important;
}


/* ===== V66 HOTFIX: font + FontAwesome + direction mode cards ===== */
html,
body,
button,
input,
select,
textarea,
.leaflet-container {
  font-family: Arial, Helvetica, sans-serif !important;
  font-synthesis: none;
}

.fa-solid,
.fa-regular,
.fas,
.far {
  font-family: "Font Awesome 6 Free" !important;
}

.fa-brands,
.fab {
  font-family: "Font Awesome 6 Brands" !important;
}

.fa-solid,
.fas {
  font-weight: 900 !important;
}

.fa-regular,
.far {
  font-weight: 400 !important;
}

.brand-text h1,
.panel-header h2,
.drawer-header h3,
.popup-title,
.place-name,
.route-name,
.section-title {
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.mode-card {
  min-height: 58px !important;
  padding: 8px 6px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  text-align: center !important;
}

.mode-card i {
  width: auto !important;
  display: block !important;
  margin: 0 !important;
  font-size: 17px !important;
  line-height: 1 !important;
}

.mode-card span {
  display: block !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
}

.direction-result .places,
.direction-info .places {
  font-family: Arial, Helvetica, sans-serif !important;
}


/* ===== V67 FONT STABILITY PATCH - giá»¯ nguyÃªn bá»‘ cá»¥c Ä‘Ã£ duyá»‡t ===== */
:root {
  --font-ui: "Segoe UI", Arial, Tahoma, Helvetica, sans-serif;
}

html,
body,
button,
input,
select,
textarea,
.leaflet-container,
.leaflet-popup-content,
.leaflet-tooltip {
  font-family: var(--font-ui) !important;
  font-synthesis: none !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-size: 14px !important;
  font-weight: 400 !important;
}

.brand-text h1,
.panel-header h2,
.drawer-header h3,
.popup-title,
.place-name,
.route-name,
.section-title,
.btn,
.nav-item,
.admin-link,
.lang-btn,
.stat-card strong {
  font-family: var(--font-ui) !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.agency-name,
.panel-eyebrow,
.drawer-eyebrow {
  font-family: var(--font-ui) !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
}

/* KhÃ´ng Ä‘á»ƒ rule font chung Ä‘Ã¨ Font Awesome */
.fa,
.fas,
.far,
.fab,
.fa-solid,
.fa-regular,
.fa-brands,
i.fa-solid,
i.fa-regular,
i.fa-brands {
  font-style: normal !important;
  line-height: 1 !important;
}

.fa,
.fas,
.fa-solid,
i.fa-solid {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
}

.far,
.fa-regular,
i.fa-regular {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 400 !important;
}

.fab,
.fa-brands,
i.fa-brands {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400 !important;
}

/* Sá»­a riÃªng Ã´ phÆ°Æ¡ng tiá»‡n: giá»¯ giao diá»‡n cÅ©, chá»‰ lÃ m icon/chá»¯ khÃ´ng lá»—i vÃ  khÃ´ng lá»‡ch */
.mode-card {
  position: relative !important;
  min-height: 58px !important;
  padding: 8px 6px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  text-align: center !important;
  overflow: hidden !important;
}

.mode-card i {
  position: static !important;
  display: block !important;
  width: 20px !important;
  height: 18px !important;
  margin: 0 !important;
  font-size: 16px !important;
  line-height: 18px !important;
  text-align: center !important;
}

.mode-card span {
  display: block !important;
  font-family: var(--font-ui) !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

/* Giáº£m cáº£m giÃ¡c chá»¯ bá»‹ quÃ¡ Ä‘áº­m á»Ÿ ná»™i dung mÃ´ táº£ */
.popup-desc,
.popup-info,
.place-desc,
.note,
.intro-card p,
.direction-summary .places,
.step-item,
.app-footer {
  font-family: var(--font-ui) !important;
  font-weight: 400 !important;
}

/* ===== V68 stable refinements: dashboard, nearby search, route cards ===== */
:root {
  --font-ui: "Segoe UI", Tahoma, Arial, sans-serif;
}

html,
body,
button,
input,
select,
textarea,
.leaflet-container,
.leaflet-popup-content,
.leaflet-tooltip {
  font-family: var(--font-ui) !important;
}

body {
  font-weight: 400 !important;
}

.brand-text h1,
.panel-header h2,
.drawer-header h3,
.popup-title,
.place-name,
.section-title,
.btn,
.nav-item,
.admin-link,
.lang-btn,
.stat-card strong {
  font-weight: 650 !important;
  letter-spacing: 0 !important;
}

/* .intro-card:first-child { display: none; } */
.dashboard-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 16px;
}

.dashboard-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  padding: 12px 13px;
  min-height: 78px;
}

.dashboard-card.wide {
  grid-column: 1 / -1;
}

.dashboard-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.dashboard-card strong {
  display: block;
  color: var(--blue-800);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
}

.dashboard-card.wide strong {
  color: var(--text-strong);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearby-box {
  border: 1px solid #cfe2f8;
  background: #f8fbff;
  border-radius: 10px;
  padding: 13px;
  margin-bottom: 16px;
}

.nearby-head strong {
  display: block;
  color: var(--blue-900);
  font-size: 14px;
  margin-bottom: 4px;
}

.nearby-head p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 10px;
}

.nearby-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.nearby-controls select {
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

.nearby-results {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

.nearby-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 9px;
  font-size: 12px;
}

.nearby-item button {
  border: 0;
  color: var(--blue-800);
  background: transparent;
  font-weight: 700;
}

.route-card {
  border-radius: 11px !important;
  border: 1px solid #d6e1ef !important;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%) !important;
}

.route-card.active {
  border-color: var(--blue-700) !important;
  box-shadow: 0 8px 24px rgba(23, 74, 139, 0.14) !important;
}

.route-main {
  padding: 14px !important;
}

.route-color {
  width: 6px !important;
}

.route-name {
  font-size: 16px !important;
  color: var(--blue-950) !important;
}

.route-desc {
  color: #52647b !important;
}

.route-foot {
  border-top: 1px solid var(--border);
  padding-top: 9px;
  margin-top: 10px !important;
}

.folder-tree {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f172a;
  color: #e5eefc;
  overflow-x: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.user-location-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1677ff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 8px rgba(22, 119, 255, .18), 0 2px 8px rgba(0, 0, 0, .25);
}

@media (max-width: 560px) {
  .nearby-controls {
    grid-template-columns: 1fr;
  }

  .dashboard-strip {
    grid-template-columns: 1fr;
  }
}

/* ===== V71: professional dashboard, improved tourism routes, clear radius ===== */
.dashboard-grid.pro-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.dashboard-tile {
  position: relative;
  min-height: 86px;
  padding: 14px 14px 12px;
  border: 1px solid #dbe5f1;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 3px 10px rgba(13, 47, 94, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-tile.primary {
  border-color: #bdd5f2;
  background: linear-gradient(135deg, #eef6ff 0%, #ffffff 100%);
}

.dashboard-tile.wide {
  grid-column: 1 / -1;
}

.dashboard-tile .tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #174a8b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.dashboard-tile:nth-child(2) .tile-icon {
  background: #047857;
}

.dashboard-tile:nth-child(3) .tile-icon {
  background: #b45309;
}

.dashboard-tile:nth-child(4) .tile-icon {
  background: #6d28d9;
}

.dashboard-tile:nth-child(5) .tile-icon {
  background: #be185d;
}

.dashboard-tile:nth-child(6) .tile-icon {
  background: #f59e0b;
  color: #1f2937;
}

.dashboard-tile span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.dashboard-tile strong {
  display: block;
  margin-top: 5px;
  color: #102a43;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 700;
}

.dashboard-tile.wide strong {
  font-size: 17px;
  line-height: 1.35;
}

.nearby-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.nearby-controls .btn {
  width: 100%;
}

.route-card.route-card-pro {
  border-radius: 13px !important;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d8e2ee;
  box-shadow: 0 3px 12px rgba(15, 35, 55, 0.07);
}

.route-card.route-card-pro:hover,
.route-card.route-card-pro.active {
  border-color: #1f5aa8;
  box-shadow: 0 8px 20px rgba(15, 35, 55, 0.13);
}

.route-cover {
  height: 96px;
  position: relative;
  background-size: cover;
  background-position: center;
}

.route-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 47, 99, .08) 0%, rgba(8, 47, 99, .45) 100%);
}

.route-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  height: 30px;
  min-width: 42px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}

.route-card-pro .route-main {
  padding: 14px !important;
}

.route-card-pro .route-color {
  width: 6px !important;
  border-radius: 999px;
}

.route-card-pro .route-name {
  font-size: 16px !important;
  line-height: 1.3;
  color: #082f63 !important;
}

.route-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.route-meta-grid span {
  min-height: 36px;
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  background: #f8fbff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
}

.route-meta-grid i {
  color: #174a8b;
}

.route-meta-grid b {
  color: #082f63;
}

.route-type-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.route-type-tags em {
  font-style: normal;
  border-radius: 999px;
  background: #eef6ff;
  color: #174a8b;
  border: 1px solid #cfe2f8;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.route-view-btn {
  width: 100%;
  height: 36px;
  margin-top: 11px;
  border: 1px solid #174a8b;
  border-radius: 8px;
  background: #174a8b;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.route-view-btn:hover {
  background: #082f63;
}

.selected-route-summary {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #dbe5f1;
  border-radius: 11px;
  background: linear-gradient(135deg, #eef6ff 0%, #ffffff 100%);
}

.selected-route-title {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.selected-route-title>span {
  width: 7px;
  min-height: 42px;
  border-radius: 999px;
  flex-shrink: 0;
}

.selected-route-title strong {
  display: block;
  color: #082f63;
  font-size: 15px;
  line-height: 1.3;
}

.selected-route-title small {
  display: block;
  color: #64748b;
  margin-top: 4px;
  font-size: 12px;
}

.route-step-pro .timeline-track {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.route-step-pro .timeline-content {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 11px;
  margin-bottom: 10px;
  flex: 1;
}

.route-step-pro .timeline-content button {
  margin-top: 8px;
  border: 1px solid #d8e2ee;
  background: #fff;
  color: #174a8b;
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 520px) {

  .dashboard-grid.pro-dashboard,
  .route-meta-grid {
    grid-template-columns: 1fr;
  }
}


/* ===== V73 PATCH: compact toolbar, clean attribution, final i18n polish ===== */
.map-toolbar {
  left: auto !important;
  right: 14px !important;
  top: 196px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  z-index: 775 !important;
}

.map-toolbar button {
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 8px !important;
}

.map-toolbar button span {
  display: none !important;
}

.map-toolbar button i {
  font-size: 16px !important;
}

.right-tab-stack {
  top: 92px !important;
  right: 14px !important;
  z-index: 780 !important;
}

.right-drawer.open~.map-toolbar,
.right-drawer.open~.right-tab-stack,
.right-drawer.open~.north-arrow {
  display: none !important;
}

.leaflet-control-attribution {
  margin-right: 70px !important;
  font-size: 11px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
}

.leaflet-control-attribution a {
  color: var(--blue-800) !important;
  text-decoration: none !important;
}

/* ===== V74 PATCH: clean attribution + stable boundary loading ===== */
.leaflet-control-attribution {
  right: 18px !important;
  bottom: 10px !important;
  margin-right: 0 !important;
  padding: 3px 8px !important;
  border-radius: 7px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: #334155 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  box-shadow: 0 1px 5px rgba(15, 35, 55, 0.12) !important;
}

.leaflet-control-attribution a,
.leaflet-control-attribution .compact-attribution {
  color: #334155 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}


/* ================================
   V75 FINAL UI POLISH
   - Giá»¯ layout Ä‘Ã£ duyá»‡t
   - LÃ m gá»n Leaflet/Esri attribution
   - NÃ¢ng Dashboard vÃ  Route Card nháº¹
================================ */

.leaflet-container {
  font-family: "Segoe UI", Tahoma, Arial, Helvetica, sans-serif !important;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.92) !important;
  padding: 3px 8px !important;
  border-radius: 6px 0 0 0 !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  color: #4b5563 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14) !important;
}

.leaflet-control-attribution a {
  color: #174a8b !important;
  text-decoration: none !important;
  font-weight: 600 !important;
}

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: 0 2px 10px rgba(15, 35, 55, 0.18) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

.leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  font-size: 18px !important;
  color: #174a8b !important;
  background: #fff !important;
  border-bottom: 1px solid #d8e2ee !important;
}

.leaflet-control-zoom a:hover {
  background: #eef6ff !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18) !important;
}

.leaflet-popup-tip {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14) !important;
}

.dashboard-grid.pro-dashboard {
  gap: 12px !important;
}

.dashboard-tile {
  min-height: 92px !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8fd 100%) !important;
  box-shadow: 0 4px 14px rgba(13, 47, 94, 0.08) !important;
}

.dashboard-tile:hover {
  transform: translateY(-1px);
  transition: 0.18s ease;
  box-shadow: 0 8px 20px rgba(13, 47, 94, 0.12) !important;
}

.dashboard-tile .tile-icon {
  border-radius: 12px !important;
}

.dashboard-tile span {
  letter-spacing: 0.01em !important;
}

.route-card.route-card-pro {
  border-radius: 14px !important;
  border-color: #d7e3f2 !important;
  box-shadow: 0 4px 14px rgba(15, 35, 55, 0.08) !important;
}

.route-card.route-card-pro:hover,
.route-card.route-card-pro.active {
  border-color: #174a8b !important;
  box-shadow: 0 10px 24px rgba(15, 35, 55, 0.15) !important;
}

.route-card.route-card-pro.active {
  outline: 3px solid rgba(23, 74, 139, 0.14) !important;
  transform: translateY(-1px);
}

.route-card.route-card-pro.is-unavailable {
  border-style: dashed !important;
}

.route-card.route-card-pro.is-unavailable .route-cover {
  filter: saturate(.82);
}

.route-cover {
  height: 106px !important;
}

.route-cover-overlay {
  background: linear-gradient(180deg, rgba(8, 47, 99, .05) 0%, rgba(8, 47, 99, .58) 100%) !important;
}

.route-badge {
  font-weight: 700 !important;
}

.route-view-count {
  position: absolute;
  right: 12px;
  top: 12px;
  min-height: 30px;
  min-width: 58px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, .42);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .22);
}

.route-view-count i {
  font-size: 11px;
}

.route-card-pro .route-name {
  font-size: 16.5px !important;
  color: #082f63 !important;
}

.route-meta-grid span {
  background: #ffffff !important;
  border-color: #d7e3f2 !important;
}

.route-status-note {
  margin-top: 9px;
  min-height: 32px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.route-status-note.subtle {
  border-color: #dbe5f1;
  background: #f8fbff;
  color: #52647b;
}

.route-status-note.timeline-note {
  margin: -2px 0 12px;
}

.route-empty-state {
  min-height: 132px;
  border: 1px dashed #bed3ee;
  border-radius: 12px;
  background: #f8fbff;
  color: #52647b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 18px;
  text-align: center;
}

.route-empty-state.compact {
  min-height: 108px;
}

.route-empty-state i {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #eef6ff;
  color: #174a8b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.route-empty-state strong {
  color: #082f63;
  font-size: 14px;
}

.route-empty-state span {
  max-width: 260px;
  font-size: 12.5px;
  line-height: 1.45;
}

.route-type-tags em {
  background: #eef6ff !important;
  border-color: #cfe2f8 !important;
  color: #174a8b !important;
}

.route-view-btn {
  border-radius: 9px !important;
  background: #174a8b !important;
}

.route-view-btn:hover {
  background: #082f63 !important;
}


/* ===== V76 FINAL ATTRIBUTION - Leaflet flag + Esri label ===== */
.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.92) !important;
  padding: 2px 6px !important;
  border-radius: 4px 0 0 0 !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  color: #334155 !important;
  box-shadow: 0 1px 3px rgba(15, 35, 55, 0.16) !important;
}

.leaflet-control-attribution a,
.leaflet-control-attribution span {
  color: #174a8b !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

.leaflet-brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  color: #174a8b !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

.leaflet-brand-flag {
  display: inline-block !important;
  width: 12px !important;
  height: 8px !important;
  flex: 0 0 auto !important;
  vertical-align: -1px !important;
  box-shadow: 0 0 0 1px rgba(15, 35, 55, 0.12) !important;
}

:root {
  --footer-h: 0px !important;
}

/* === RESTORED UI/UX FIXES === */
.main-nav {
  margin-left: 16px !important;
}

.map-toolbar {
  top: 310px !important;
}

.map-toolbar button::after,
.right-tab-stack .right-tab-btn::after {
  position: absolute;
  right: calc(100% + 9px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 500;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.map-toolbar button::after {
  content: attr(data-tooltip);
}

.right-tab-stack .right-tab-btn::after {
  content: attr(title);
}

.right-tab-stack .right-tab-btn:hover::after,
.map-toolbar button:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* === GLOBAL SEARCH RESTORE === */
.global-search {
  position: relative;
  width: min(360px, 24vw);
  height: 36px;
  flex: 0 1 360px;
  display: grid;
  grid-template-columns: 28px 92px minmax(120px, 1fr);
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  overflow: visible;
}

.global-search>svg,
.global-search>i {
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.9);
}

.global-search select,
.global-search input {
  height: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  outline: none;
  font-family: inherit;
  font-size: 13px;
}

.global-search select {
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0 5px;
}

.global-search select option {
  color: #333;
}

.global-search input {
  padding: 0 12px;
}

.global-search input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.global-search:focus-within {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.global-search-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  color: #333;
}

.global-search-suggest.show {
  display: block;
}

.global-suggest-item {
  width: 100%;
  border: 0;
  background: #fff;
  color: var(--text);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid #edf2f7;
}

.global-suggest-item:last-child {
  border-bottom: 0;
}

.global-suggest-item:hover,
.global-suggest-item:focus {
  background: #eef6ff;
  outline: 0;
}

.global-suggest-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(15, 35, 55, 0.14);
}

.global-suggest-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.global-suggest-text strong,
.global-suggest-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-suggest-text strong {
  color: #082f63;
  font-size: 13.5px;
  font-weight: 900;
}

.global-suggest-text small {
  color: #52647b;
  font-size: 12px;
}

.global-suggest-empty {
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #52647b;
  font-size: 13px;
  font-weight: 700;
}

.global-suggest-empty i {
  color: #174a8b;
}

/* === LATEST USER REQUESTS === */
.agency-name {
  font-size: 10px !important;
}

.brand-text h1 {
  font-size: 16px !important;
}

.main-nav .nav-item i {
  display: none !important;
}

.main-nav .nav-item span {
  display: inline-block !important;
}

.main-nav .nav-item {
  width: auto !important;
  padding: 0 12px !important;
}

/* === NEW LANGUAGE SWITCHER === */
.map-lang-switcher {
  position: absolute;
  right: 18px;
  bottom: 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  padding: 4px;
  z-index: 1000;
  gap: 2px;
}

.map-lang-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 700;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-lang-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.map-lang-btn.active {
  background: #0f172a;
  color: #fff;
}

/* === MINITOOLS GROUPING UX FIX === */
.right-tab-stack,
.map-toolbar {
  gap: 0 !important;
  background: #fff !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  overflow: visible !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.right-tab-stack .right-tab-btn,
.map-toolbar button {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  width: 42px !important;
  height: 42px !important;
  margin: 0 !important;
}

.right-tab-stack .right-tab-btn:first-child,
.map-toolbar button:first-child {
  border-top-left-radius: 8px !important;
  border-top-right-radius: 8px !important;
}

.right-tab-stack .right-tab-btn:last-child,
.map-toolbar button:last-child {
  border-bottom: none !important;
  border-bottom-left-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
}

.map-toolbar {
  top: 196px !important;
}

/* === HEADER COMPACT ARRANGEMENT: keep text tabs visible, prevent search overlap === */
.app-header {
  display: grid !important;
  grid-template-columns: minmax(350px, 440px) minmax(590px, 1fr) minmax(360px, 540px) max-content !important;
  align-items: center !important;
  column-gap: 16px !important;
  height: 64px !important;
  padding: 0 30px !important;
}

.brand-area {
  min-width: 0 !important;
  width: auto !important;
  gap: 12px !important;
}

.brand-logo {
  width: 42px !important;
  height: 42px !important;
}

.brand-text {
  min-width: 0 !important;
}

.agency-name {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.brand-text h1 {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.main-nav {
  width: 100% !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
  justify-content: flex-start !important;
  gap: 6px !important;
}

.main-nav .nav-item {
  height: 42px !important;
  min-width: 0 !important;
  padding: 0 13px !important;
  flex: 0 1 auto !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  line-height: 1 !important;
}

.main-nav .nav-item span {
  display: inline-block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.global-search {
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
  justify-self: stretch !important;
  grid-template-columns: 30px 94px minmax(0, 1fr) !important;
}

.header-actions {
  min-width: 0 !important;
  justify-self: end !important;
}

.admin-link {
  height: 38px !important;
  padding: 0 16px !important;
  border-radius: 8px !important;
  font-size: 15px !important;
}

@media (max-width: 1600px) {
  .app-header {
    grid-template-columns: minmax(310px, 360px) minmax(520px, 1fr) minmax(330px, 430px) max-content !important;
    column-gap: 12px !important;
    padding: 0 22px !important;
  }

  .main-nav {
    gap: 4px !important;
  }

  .main-nav .nav-item {
    padding: 0 10px !important;
    font-size: 14px !important;
  }

  .admin-link {
    padding: 0 13px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 1360px) {
  .app-header {
    grid-template-columns: minmax(270px, 315px) minmax(470px, 1fr) minmax(280px, 360px) max-content !important;
    column-gap: 10px !important;
    padding: 0 16px !important;
  }

  .brand-logo {
    width: 38px !important;
    height: 38px !important;
  }

  .agency-name {
    font-size: 9.5px !important;
  }

  .brand-text h1 {
    font-size: 15px !important;
  }

  .main-nav .nav-item {
    height: 40px !important;
    padding: 0 8px !important;
    font-size: 13.5px !important;
  }

  .global-search {
    height: 36px !important;
    grid-template-columns: 28px 86px minmax(0, 1fr) !important;
  }
}

@media (max-width: 1160px) {
  .app-header {
    height: auto !important;
    min-height: 64px !important;
    grid-template-columns: minmax(260px, 1fr) max-content !important;
    grid-template-areas:
      "brand admin"
      "nav search" !important;
    row-gap: 8px !important;
    padding: 10px 14px !important;
  }

  .brand-area {
    grid-area: brand;
  }

  .main-nav {
    grid-area: nav;
    overflow-x: auto !important;
    scrollbar-width: thin;
  }

  .main-nav .nav-item {
    flex: 0 0 auto !important;
  }

  .global-search {
    grid-area: search;
    width: min(380px, 42vw) !important;
    justify-self: end !important;
  }

  .header-actions {
    grid-area: admin;
  }
}

/* === NAV TEXT OVERFLOW FIX === */
.global-search {
  width: 220px !important;
  flex: 0 1 220px !important;
}

.main-nav .nav-item {
  padding: 0 6px !important;
  font-size: 12.5px !important;
  flex: 0 0 auto !important;
}

.main-nav .nav-item span {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

/* === EXPAND SEARCH BAR UX FIX === */
@media (min-width: 1041px) {
  .app-header {
    grid-template-columns: auto max-content 1fr max-content !important;
    column-gap: 20px !important;
  }
}

.global-search {
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 auto !important;
}

/* === SEARCH DROPDOWN WIDTH FIX === */
.global-search {
  grid-template-columns: 28px max-content minmax(0, 1fr) !important;
}

.global-search select {
  padding-right: 2px !important;
  padding-left: 2px !important;
}

/* === SEARCH DROPDOWN REMOVE ICON SPACE FIX === */
.global-search {
  grid-template-columns: max-content minmax(0, 1fr) !important;
}

.global-search>i,
.global-search>svg {
  display: none !important;
}

.global-search select {
  padding-left: 10px !important;
  padding-right: 8px !important;
}

/* === FIX EMPTY TOOLTIP ON MAP TOOLBAR === */
.map-toolbar button::after {
  display: none !important;
}

.map-toolbar button {
  position: relative !important;
  overflow: visible !important;
}

.map-toolbar button span {
  display: block !important;
  position: absolute !important;
  right: calc(100% + 9px) !important;
  top: 50% !important;
  transform: translateY(-50%) translateX(4px) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  white-space: nowrap !important;
  border-radius: 6px !important;
  background: rgba(15, 23, 42, 0.92) !important;
  color: #fff !important;
  padding: 5px 8px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  transition: opacity 0.14s ease, transform 0.14s ease !important;
  z-index: 1000 !important;
}

.map-toolbar button:hover span {
  opacity: 1 !important;
  transform: translateY(-50%) translateX(0) !important;
}

/* === ZOOM CONTROL RIGHT SIDE FIX === */
.leaflet-top.leaflet-right .leaflet-control-zoom {
  margin-top: 340px !important;
  margin-right: 14px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

.leaflet-control-zoom a {
  width: 42px !important;
  height: 42px !important;
  line-height: 42px !important;
  color: var(--blue-900) !important;
  font-size: 18px !important;
  background: #fff !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(255, 255, 255, 0.9) !important;
}

/* === COMPACT DASHBOARD TILES UX FIX === */
.dashboard-tile {
  min-height: 72px !important;
  padding: 10px 12px !important;
  gap: 10px !important;
}

.dashboard-tile .tile-icon {
  width: 36px !important;
  height: 36px !important;
  font-size: 14px !important;
  border-radius: 10px !important;
}

.dashboard-tile strong {
  font-size: 20px !important;
  margin-top: 2px !important;
}

.dashboard-tile span {
  font-size: 10.5px !important;
}

.dashboard-grid.pro-dashboard {
  gap: 8px !important;
  margin-top: 10px !important;
  margin-bottom: 14px !important;
}

/* === MODERN COMPACT OVERVIEW METRICS === */
.dashboard-grid.pro-dashboard {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 7px !important;
  align-items: stretch !important;
  margin: 6px 0 12px !important;
}

.dashboard-grid.pro-dashboard .dashboard-tile {
  grid-column: span 2;
  min-height: 54px !important;
  padding: 7px 9px !important;
  border-radius: 9px !important;
  border-color: #d9e6f5 !important;
  background: #fff !important;
  box-shadow: 0 4px 12px rgba(15, 42, 74, 0.045) !important;
  gap: 8px !important;
}

.dashboard-grid.pro-dashboard .dashboard-tile:nth-child(4),
.dashboard-grid.pro-dashboard .dashboard-tile:nth-child(5) {
  grid-column: span 3;
}

.dashboard-grid.pro-dashboard .dashboard-tile .tile-icon {
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
}

.dashboard-grid.pro-dashboard .dashboard-tile>div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dashboard-grid.pro-dashboard .dashboard-tile strong {
  order: -1;
  min-height: 23px;
  margin: 0 0 1px !important;
  font-size: 20px !important;
  line-height: 1.12 !important;
  letter-spacing: 0 !important;
}

.dashboard-grid.pro-dashboard .dashboard-tile span {
  max-width: 100%;
  color: #60738d !important;
  font-size: 9.5px !important;
  line-height: 1.14 !important;
  letter-spacing: .01em !important;
  overflow: hidden;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 620px) {
  .dashboard-grid.pro-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .dashboard-grid.pro-dashboard .dashboard-tile,
  .dashboard-grid.pro-dashboard .dashboard-tile:nth-child(4),
  .dashboard-grid.pro-dashboard .dashboard-tile:nth-child(5) {
    grid-column: span 1;
  }
}

/* === PLACE DETAIL PANEL + MINIMAL MAP POPUP === */
.popup-card.popup-compact {
  max-height: none;
  overflow: hidden;
}

.popup-card.popup-compact .popup-img-wrap {
  height: 92px;
}

.popup-card.popup-compact .popup-body {
  padding: 10px 11px 11px;
}

.popup-card.popup-compact .popup-title {
  margin-bottom: 7px;
  font-size: 15px;
  line-height: 1.25;
}

.popup-card.popup-compact .popup-tags {
  margin-bottom: 8px;
}

.popup-card.popup-compact .popup-route-line {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 10px;
  color: #54677f;
  font-size: 12px;
  line-height: 1.35;
}

.popup-card.popup-compact .popup-route-line i {
  color: var(--blue-700);
  margin-top: 2px;
}

.popup-card.popup-compact .popup-actions {
  grid-template-columns: 1fr 1fr;
}

.popup-card.popup-compact .popup-btn {
  min-height: 34px;
  font-size: 12px;
}

.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.detail-actions-top {
  display: flex;
  align-items: center;
}

.detail-back-btn {
  height: 34px;
  border: 1px solid #d9e6f5;
  border-radius: 8px;
  background: #fff;
  color: var(--blue-800);
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 42, 74, 0.04);
}

.detail-back-btn:hover {
  background: #f7fbff;
  border-color: #bed3ee;
}

.detail-carousel {
  position: relative;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d9e6f5;
  background: #eef3f8;
  box-shadow: 0 8px 20px rgba(15, 42, 74, 0.06);
}

.detail-carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 35, 55, 0.72);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
}

.detail-carousel-btn.prev {
  left: 10px;
}

.detail-carousel-btn.next {
  right: 10px;
}

.detail-carousel-btn:disabled {
  display: none;
}

.detail-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 9px;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(15, 35, 55, 0.45);
}

.detail-carousel-dots button {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  padding: 0;
  cursor: pointer;
}

.detail-carousel-dots button.active {
  width: 16px;
  border-radius: 999px;
  background: #fff;
}

.detail-heading {
  padding-bottom: 2px;
}

.detail-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue-800);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-heading h3 {
  margin: 8px 0 6px;
  color: var(--text-strong);
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: 0;
}

.detail-route-name {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  color: #52647b;
  font-size: 13px;
  line-height: 1.45;
}

.detail-route-name:empty {
  display: none;
}

.detail-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-info-list {
  display: grid;
  gap: 8px;
}

.detail-info-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid #d9e6f5;
  border-radius: 9px;
  background: #fff;
}

.detail-info-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--blue-800);
  display: grid;
  place-items: center;
}

.detail-info-text {
  min-width: 0;
  color: #263442;
  font-size: 13px;
  line-height: 1.42;
}

.detail-info-text b {
  color: #61758f;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .01em;
  display: block;
  margin-bottom: 2px;
}

.detail-section {
  padding: 12px;
  border: 1px solid #d9e6f5;
  border-radius: 10px;
  background: #fff;
}

.section-title.compact {
  margin: 0 0 8px;
  font-size: 13px;
}

.detail-description {
  margin: 0;
  color: #3f5065;
  font-size: 13px;
  line-height: 1.6;
}

.detail-video-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 9px;
  background: #eef3f8;
}

.detail-video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

#detailVideoSection.hidden {
  display: none;
}

/* === POLISHED SEARCH MODE + PANEL TOGGLE === */
.global-search {
  grid-template-columns: max-content minmax(0, 1fr) !important;
  overflow: visible !important;
  border-color: rgba(255, 255, 255, 0.34) !important;
  background: rgba(255, 255, 255, 0.13) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.global-search-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.search-mode-picker {
  position: relative;
  height: 100%;
  z-index: 10;
}

.search-mode-btn {
  height: 100%;
  min-width: 118px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px 0 0 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 0 14px;
  font-size: 12.5px;
  font-weight: 600;
}

.search-mode-btn:hover,
.search-mode-picker.open .search-mode-btn {
  background: rgba(255, 255, 255, 0.16);
}

.search-mode-btn i {
  font-size: 11px;
  opacity: .86;
  transition: transform .16s ease;
}

.search-mode-picker.open .search-mode-btn i {
  transform: rotate(180deg);
}

.search-mode-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 136px;
  padding: 5px;
  border-radius: 9px;
  border: 1px solid #d8e2ee;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 35, 55, 0.18);
  display: none;
  color: #1f2937;
}

.search-mode-picker.open .search-mode-menu {
  display: grid;
  gap: 3px;
}

.search-mode-menu button {
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #263442;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
}

.search-mode-menu button:hover {
  background: #eef6ff;
  color: var(--blue-800);
}

.search-mode-menu button.active {
  background: var(--blue-800);
  color: #fff;
  font-weight: 600;
}

.global-search input {
  padding-left: 14px !important;
}

.collapse-btn,
.open-left-btn {
  width: 40px !important;
  height: 40px !important;
  border: 1px solid #cfe0f3 !important;
  border-radius: 11px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%) !important;
  color: var(--blue-800) !important;
  box-shadow: 0 8px 20px rgba(15, 42, 74, 0.08) !important;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease !important;
}

.collapse-btn:hover,
.open-left-btn:hover {
  transform: translateY(-1px);
  background: var(--blue-800) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(23, 74, 139, 0.22) !important;
}

.collapse-btn i,
.open-left-btn i {
  font-size: 15px;
}

.open-left-btn {
  left: 14px !important;
  top: 96px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(10px);
}

.open-left-btn::after {
  content: "Bảng thông tin";
  position: absolute;
  left: calc(100% + 9px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 6px 9px;
  font-size: 11.5px;
  font-weight: 700;
  transition: opacity .16s ease, transform .16s ease;
}

.open-left-btn:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.detail-action-row {
  margin-top: 2px;
}

/* === MINIMAL DASHBOARD ICONS UX FIX === */
.dashboard-tile .tile-icon {
  background: transparent !important;
  border-radius: 50% !important;
}

.dashboard-tile:nth-child(1) .tile-icon {
  background: rgba(23, 74, 139, 0.08) !important;
  color: #174a8b !important;
}

.dashboard-tile:nth-child(2) .tile-icon {
  background: rgba(4, 120, 87, 0.08) !important;
  color: #047857 !important;
}

.dashboard-tile:nth-child(3) .tile-icon {
  background: rgba(180, 83, 9, 0.08) !important;
  color: #b45309 !important;
}

.dashboard-tile:nth-child(4) .tile-icon {
  background: rgba(109, 40, 217, 0.08) !important;
  color: #6d28d9 !important;
}

.dashboard-tile:nth-child(5) .tile-icon {
  background: rgba(190, 24, 93, 0.08) !important;
  color: #be185d !important;
}

/* Ensure Lucide svg inside .tile-icon scales nicely */
.dashboard-tile .tile-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2px;
}

.dashboard-grid.pro-dashboard .dashboard-tile .tile-icon {
  background: #fff !important;
  border: 1px solid #d9e6f5 !important;
  color: #174a8b !important;
  border-radius: 10px !important;
}

.dashboard-grid.pro-dashboard .dashboard-tile .tile-icon svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 1.9 !important;
}

.featured-route-title {
  margin-top: 16px;
}

.featured-route-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.featured-place-card,
.featured-route-card {
  cursor: pointer;
}

.featured-place-card:focus,
.featured-route-card:focus {
  outline: 3px solid rgba(23, 74, 139, 0.14);
  border-color: #174a8b;
}

.featured-place-thumb,
.featured-route-thumb {
  width: 96px;
  height: 82px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-color: #e2e8f0;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.featured-place-thumb::after,
.featured-route-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 47, 99, 0.08), rgba(8, 47, 99, 0.34));
}

.featured-place-thumb span,
.featured-route-thumb span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 4px 10px rgba(15, 35, 55, 0.18);
}


/* Fix focus outline on Leaflet interactive paths */
path.leaflet-interactive:focus,
svg.leaflet-zoom-animated:focus {
  outline: none;
}

/* === ROUTE DETAIL DRAWER: compact list left, full route detail right === */
.route-card.route-card-compact {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 10px;
  border-color: #d7e3f2 !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: 0 2px 8px rgba(15, 35, 55, 0.06) !important;
}

.route-card.route-card-compact:hover,
.route-card.route-card-compact.active {
  border-color: #174a8b !important;
  box-shadow: 0 8px 18px rgba(15, 35, 55, 0.12) !important;
}

.route-card.route-card-compact.active {
  outline: 3px solid rgba(23, 74, 139, 0.13);
}

.route-card.route-card-compact.is-unavailable {
  border-style: dashed !important;
}

.route-compact-index {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(15, 35, 55, 0.16);
}

.route-compact-body {
  min-width: 0;
}

.route-card-compact .route-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px !important;
  color: var(--text-strong) !important;
  font-weight: 600 !important;
}

.route-compact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: 7px;
  color: #52647b;
  font-size: 11.5px;
  font-weight: 800;
}

.route-compact-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.route-compact-meta i {
  color: #174a8b;
}

.route-compact-status {
  margin-top: 7px;
  color: #9a3412;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
}

.route-compact-action {
  width: 34px;
  height: 34px;
  border: 1px solid #d7e3f2;
  border-radius: 9px;
  background: #f8fbff;
  color: #174a8b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.route-card-compact:hover .route-compact-action,
.route-card-compact.active .route-compact-action {
  border-color: #174a8b;
  background: #174a8b;
  color: #fff;
}

.route-detail-drawer,
.place-detail-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(390px, 42vw);
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 28px rgba(15, 35, 55, 0.18);
  z-index: 860;
  transform: translateX(105%);
  transition: transform 0.22s ease;
  overflow-y: auto;
}

.direction-detail-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(390px, 42vw);
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 28px rgba(15, 35, 55, 0.18);
  z-index: 865;
  transform: translateX(105%);
  transition: transform 0.22s ease;
  overflow-y: auto;
}

.route-detail-drawer.open,
.place-detail-drawer.open {
  transform: translateX(0);
}

.direction-detail-drawer.open {
  transform: translateX(0);
}

.route-detail-drawer-header,
.place-detail-drawer-header {
  min-height: 84px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.direction-detail-drawer-header {
  min-height: 84px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.route-detail-drawer-header h3,
.place-detail-drawer-header h3 {
  margin-top: 4px;
  color: var(--text-strong);
  font-size: 19px;
  line-height: 1.22;
  font-weight: 900;
}

.direction-detail-drawer-header h3 {
  margin-top: 4px;
  color: var(--text-strong);
  font-size: 19px;
  line-height: 1.22;
  font-weight: 900;
}

.route-detail-drawer-header button,
.place-detail-drawer-header button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--blue-900);
  flex: 0 0 auto;
}

.direction-detail-drawer-header button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--blue-900);
  flex: 0 0 auto;
}

.route-detail-drawer-body {
  padding-bottom: 18px;
}

.place-detail-drawer-body {
  padding: 14px;
  padding-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.direction-detail-drawer-body {
  padding: 14px;
}

.direction-detail-drawer .direction-result {
  margin-top: 0;
}

.direction-detail-drawer.open~.map-toolbar,
.direction-detail-drawer.open~.right-tab-stack,
.direction-detail-drawer.open~.north-arrow,
.place-detail-drawer.open~.map-toolbar,
.place-detail-drawer.open~.right-tab-stack,
.place-detail-drawer.open~.north-arrow {
  display: none !important;
}

.route-detail-cover {
  height: 154px;
  position: relative;
  background-size: cover;
  background-position: center;
}

.route-detail-cover .route-badge {
  left: 14px;
  top: 14px;
  min-width: 38px;
  width: 38px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
}

.route-detail-content {
  padding: 14px;
}

.route-detail-content .selected-route-title {
  margin-bottom: 12px;
}

.route-detail-content .selected-route-title strong {
  font-size: 16px;
}

.route-detail-content .selected-route-title small {
  font-size: 13px;
  line-height: 1.45;
}

.route-detail-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 10px;
  padding-top: 2px;
  color: #082f63;
  font-size: 15px;
  font-weight: 900;
}

.route-detail-section-title i {
  color: #174a8b;
}

.route-detail-timeline {
  margin-bottom: 12px;
}

.route-detail-actions {
  margin-top: 14px;
}

@media (max-width: 860px) {

  .route-detail-drawer,
  .direction-detail-drawer,
  .place-detail-drawer {
    width: min(380px, calc(100% - 18px));
  }
}

@media (max-width: 560px) {
  .route-card.route-card-compact {
    grid-template-columns: 34px minmax(0, 1fr) 32px;
    gap: 8px;
  }

  .route-compact-index {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 12px;
  }

  .route-compact-meta {
    font-size: 11px;
  }

  .route-detail-drawer,
  .direction-detail-drawer,
  .place-detail-drawer {
    top: 8px;
    right: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    border: 1px solid var(--border);
    border-radius: 12px;
  }

  .route-detail-cover {
    height: 132px;
  }
}

.feedback-success-box {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #a3d9a5;
  border-radius: 8px;
  background: #f0fdf4;
  text-align: center;
  color: #166534;
}

.feedback-success-box i {
  font-size: 28px;
  color: #22c55e;
  margin-bottom: 8px;
  display: block;
}

.feedback-success-box code {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  background: #dcfce7;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.route-detail-drawer-header h3,
.place-detail-drawer-header h3 {
  margin-top: 4px;
  color: var(--text-strong);
  font-size: 19px;
  line-height: 1.22;
  font-weight: 900;
}

.direction-detail-drawer-header h3 {
  margin-top: 4px;
  color: var(--text-strong);
  font-size: 19px;
  line-height: 1.22;
  font-weight: 900;
}

.route-detail-drawer-header button,
.place-detail-drawer-header button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--blue-900);
  flex: 0 0 auto;
}

.direction-detail-drawer-header button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--blue-900);
  flex: 0 0 auto;
}

.route-detail-drawer-body {
  padding-bottom: 18px;
}

.place-detail-drawer-body {
  padding: 14px;
  padding-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.direction-detail-drawer-body {
  padding: 14px;
}

.direction-detail-drawer .direction-result {
  margin-top: 0;
}

.direction-detail-drawer.open~.map-toolbar,
.direction-detail-drawer.open~.right-tab-stack,
.direction-detail-drawer.open~.north-arrow,
.place-detail-drawer.open~.map-toolbar,
.place-detail-drawer.open~.right-tab-stack,
.place-detail-drawer.open~.north-arrow {
  display: none !important;
}

.route-detail-cover {
  height: 154px;
  position: relative;
  background-size: cover;
  background-position: center;
}

.route-detail-cover .route-badge {
  left: 14px;
  top: 14px;
  min-width: 38px;
  width: 38px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
}

.route-detail-content {
  padding: 14px;
}

.route-detail-content .selected-route-title {
  margin-bottom: 12px;
}

.route-detail-content .selected-route-title strong {
  font-size: 16px;
}

.route-detail-content .selected-route-title small {
  font-size: 13px;
  line-height: 1.45;
}

.route-detail-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 10px;
  padding-top: 2px;
  color: #082f63;
  font-size: 15px;
  font-weight: 900;
}

.route-detail-section-title i {
  color: #174a8b;
}

.route-detail-timeline {
  margin-bottom: 12px;
}

.route-detail-actions {
  margin-top: 14px;
}

@media (max-width: 860px) {

  .route-detail-drawer,
  .direction-detail-drawer,
  .place-detail-drawer {
    width: min(380px, calc(100% - 18px));
  }
}

@media (max-width: 560px) {
  .route-card.route-card-compact {
    grid-template-columns: 34px minmax(0, 1fr) 32px;
    gap: 8px;
  }

  .route-compact-index {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 12px;
  }

  .route-compact-meta {
    font-size: 11px;
  }

  .route-detail-drawer,
  .direction-detail-drawer,
  .place-detail-drawer {
    top: 8px;
    right: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    border: 1px solid var(--border);
    border-radius: 12px;
  }

  .route-detail-cover {
    height: 132px;
  }
}

.feedback-success-box {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #a3d9a5;
  border-radius: 8px;
  background: #f0fdf4;
  text-align: center;
  color: #166534;
}

.feedback-success-box i {
  font-size: 28px;
  color: #22c55e;
  margin-bottom: 8px;
  display: block;
}

.feedback-success-box code {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  background: #dcfce7;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  color: #14532d;
  letter-spacing: 0.5px;
}

.feedback-success-box small {
  display: block;
  margin-top: 8px;
  color: #4ade80;
  font-size: 12px;
}

/* ═══════ ABOUT SECTION - GUIDE STEPS ═══════ */
.about-highlight {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(135deg, #e8f4fd 0%, #dbeafe 100%);
  border-left: 3px solid #2563b8;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.5;
}

.about-highlight i {
  font-size: 18px;
  margin-top: 2px;
  color: #2563b8;
  flex-shrink: 0;
}

.guide-steps {
  list-style: none;
  counter-reset: guide;
  padding: 0;
  margin: 0 0 16px;
}

.guide-steps li {
  counter-increment: guide;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  line-height: 1.5;
  transition: background 0.2s, border-color 0.2s;
}

.guide-steps li:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.guide-steps li i {
  color: #2563b8;
  font-size: 15px;
  margin-top: 2px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* ═══════ DRIVER.JS CUSTOM OVERRIDES ═══════ */
.driver-popover {
  border-radius: 12px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
}

.driver-popover-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #1e3a5f !important;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
}

.driver-popover-description {
  font-size: 13.5px !important;
  color: #475569 !important;
  line-height: 1.6 !important;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
}

.driver-popover-navigation-btns button {
  border-radius: 6px !important;
  padding: 6px 16px !important;
  font-size: 13px !important;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  text-shadow: none !important;
}

.driver-popover-prev-btn {
  background: #f1f5f9 !important;
  color: #334155 !important;
  text-shadow: none !important;
}

.driver-popover-next-btn,
.driver-popover-done-btn {
  background: #2563b8 !important;
  color: #fff !important;
  text-shadow: none !important;
}

.driver-popover-close-btn {
  color: #94a3b8 !important;
}

.driver-popover-progress-text {
  font-size: 12px !important;
  color: #94a3b8 !important;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
}

/* Thematic map export modal and A4 portrait PNG source */
.thematic-export-root {
  position: fixed;
  inset: 0;
  display: none !important;
  background: rgba(15, 23, 42, 0.66);
  --export-preview-scale: 0.54;
  z-index: 5000;
}

.thematic-export-root.open {
  display: flex !important;
}

.thematic-export-modal {
  position: absolute;
  inset: 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #eef4fb;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.38);
}

.thematic-export-root.thematic-export-modal {
  position: fixed;
  inset: 0;
  border-radius: 0;
  z-index: 5000;
}

.thematic-export-topbar {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #174a8b 0%, #123b70 100%);
}

.thematic-export-topbar strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.thematic-export-topbar span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
}

.thematic-export-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thematic-export-actions button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.thematic-export-actions button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

#btnThematicExportPng {
  color: #ffffff;
  background: #1f6fb8;
  border-color: #1f6fb8;
  box-shadow: 0 10px 22px rgba(31, 111, 184, 0.25);
}

#btnThematicExportPng:hover {
  background: #2563b8;
  border-color: #2563b8;
}

.thematic-export-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.thematic-export-controls {
  min-height: 0;
  overflow: auto;
  padding: 15px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-right: 1px solid #d8e0eb;
}

.thematic-export-controls label {
  display: block;
  margin-bottom: 12px;
}

.thematic-export-controls label>span,
.thematic-export-toggle-group>span {
  display: block;
  margin-bottom: 6px;
  color: #24364c;
  font-size: 12px;
  font-weight: 800;
}

.thematic-export-controls input[type="text"],
.thematic-export-controls textarea,
.thematic-export-controls select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd8e7;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-size: 13px;
  padding: 9px 10px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.thematic-export-controls input[type="text"]:focus,
.thematic-export-controls textarea:focus,
.thematic-export-controls select:focus {
  outline: none;
  border-color: #174a8b;
  box-shadow: 0 0 0 3px rgba(23, 74, 139, 0.12);
}

.thematic-export-controls textarea {
  resize: vertical;
  min-height: 72px;
}

.thematic-export-toggle-group {
  padding: 12px;
  border-top: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.thematic-export-toggle-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.thematic-export-toggle-group input {
  width: 16px;
  height: 16px;
}

.thematic-export-preview {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 24px;
  background: #dde3ec;
}

.thematic-export-map-wrap {
  position: relative;
  width: 100%;
  max-width: 794px;
}

.thematic-export-agency-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.thematic-export-preview {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 18px 24px 32px;
  background: #e5e7eb;
}

.thematic-export-sheet {
  width: 794px;
  height: 1123px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  padding: 34px;
  background: #ffffff;
  color: #172033;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  border: 1px solid #d7dee8;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
  transform: scale(var(--export-preview-scale));
  transform-origin: top center;
}

.thematic-export-root.is-capturing .thematic-export-sheet {
  transform: none;
}

.thematic-export-map .leaflet-control-zoom {
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.thematic-export-map .leaflet-control-zoom a {
  width: 30px;
  height: 30px;
  line-height: 30px;
  color: #174a8b;
}

.thematic-export-root.is-capturing .thematic-export-map .leaflet-control-zoom {
  display: none;
}

.thematic-export-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid #174a8b;
}

.thematic-export-agency {
  margin: 0 0 8px;
  color: #174a8b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.thematic-export-title {
  margin: 0;
  color: #10233f;
  font-size: 28px;
  line-height: 1.18;
  font-weight: 850;
}

.thematic-export-subtitle {
  margin: 8px 0 0;
  color: #526173;
  font-size: 13px;
  line-height: 1.45;
}

.thematic-export-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: #174a8b;
  border-radius: 8px;
  font-size: 24px;
}

.thematic-export-map-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid #b7c4d5;
  background: #e8eef5;
  overflow: hidden;
}

.thematic-export-map {
  width: 100%;
  height: 100%;
}

.thematic-export-compass {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  z-index: 500;
  border: 2px solid #10233f;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #10233f;
  font-size: 15px;
  font-weight: 900;
}

.thematic-export-compass::before {
  content: "";
  position: absolute;
  top: -10px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 12px solid #c62828;
}

.thematic-export-legend-panel {
  flex: 0 0 auto;
  min-height: 132px;
  padding: 14px 16px;
  border: 1px solid #d8e0eb;
  background: #f8fafc;
}

.thematic-export-section-title {
  margin-bottom: 10px;
  color: #10233f;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.thematic-export-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.thematic-export-legend-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: #26364a;
  font-size: 12px;
  line-height: 1.35;
}

.thematic-export-legend-symbol {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
}

.thematic-export-empty {
  color: #64748b;
  font-size: 12px;
}

.thematic-export-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid #d8e0eb;
  color: #526173;
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .thematic-export-modal {
    inset: 8px;
  }

  .thematic-export-workspace {
    grid-template-columns: 1fr;
  }

  .thematic-export-controls {
    max-height: 235px;
    border-right: none;
    border-bottom: 1px solid #d8e0eb;
  }

  .thematic-export-root {
    --export-preview-scale: 0.46;
  }
}