.tm-page { max-width: 1180px; margin-inline: auto; }
.tm-head { margin-bottom: 18px; }
.tm-head h1 { margin-bottom: 8px; }
.tm-lead { margin: 0; color: var(--muted, #5c6670); font-size: 1rem; line-height: 1.5; max-width: 78ch; }
.tm-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.tm-app {
  border: 1px solid var(--line, #e2e6ea);
  border-radius: 12px;
  background: var(--card, #fff);
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .04);
}
.tm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line, #e2e6ea);
  background: var(--bg, #f7f8fa);
}
.tm-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line, #d7dde3);
  border-radius: 999px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tm-filter:hover { border-color: var(--tm-type, var(--accent, #1d6fd6)); }
.tm-filter.is-active {
  background: var(--tm-type, var(--region-ink, var(--accent, #1d6fd6)));
  border-color: var(--tm-type, var(--region-ink, var(--accent, #1d6fd6)));
  color: #fff;
}
.tm-filter.is-active .tm-dot { background: #fff; }
.tm-filter.is-active .tm-count { background: rgba(255, 255, 255, .22); color: #fff; }
.tm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tm-type, #1d6fd6);
  flex: none;
}
.tm-count {
  font-size: .78rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .07);
}
.tm-search-wrap { flex: 1 1 220px; max-width: 340px; }
.tm-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--line, #d0d7de);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: .92rem;
}
.tm-search:focus { outline: 2px solid var(--accent, #1d6fd6); outline-offset: 1px; }

.tm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 520px;
}
.tm-map-col { position: relative; min-width: 0; }
.tm-map-wrap { position: relative; height: 100%; min-height: 520px; }
.tm-map { width: 100%; height: 100%; min-height: 520px; z-index: 1; background: #eef1f4; }
.tm-active-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(20, 27, 36, .92);
  color: #fff;
  font-size: .88rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}
.tm-active-bar[hidden] { display: none; }
.tm-reset-btn {
  flex: none;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #141b24;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}
.tm-reset-btn:hover { background: #e8edf2; }

.tm-sidebar {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line, #e2e6ea);
  max-height: 560px;
  min-width: 0;
  background: var(--card, #fff);
}
.tm-list-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line, #e2e6ea);
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted, #5c6670);
  background: var(--bg, #f9fafb);
}
.tm-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tm-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.tm-item:hover { background: var(--bg, #f4f6f8); }
.tm-item.is-selected {
  background: rgba(29, 111, 214, .08);
  border-color: var(--accent, #1d6fd6);
}
.tm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 4px 7px;
  border-radius: 6px;
  color: #fff;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.15;
  flex: none;
}
.tm-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tm-item-type { font-size: .9rem; font-weight: 650; line-height: 1.25; }
.tm-item-dir { font-size: .82rem; color: var(--muted, #5c6670); line-height: 1.3; word-break: break-word; }
.tm-empty { padding: 18px 12px; color: var(--muted, #5c6670); font-size: .9rem; margin: 0; }

.tm-detail {
  border-bottom: 2px solid var(--line, #e2e6ea);
  padding: 12px 14px;
  background: #fbfcfd;
  max-height: 300px;
  overflow-y: auto;
}
.tm-detail[hidden] { display: none; }
.tm-detail-top { display: flex; align-items: flex-start; gap: 10px; }
.tm-detail-titles { flex: 1 1 auto; min-width: 0; }
.tm-detail-type { display: block; font-size: .96rem; line-height: 1.25; }
.tm-detail-dir { margin: 3px 0 0; font-size: .84rem; color: var(--muted, #5c6670); line-height: 1.35; }
.tm-detail-close {
  border: 0;
  background: transparent;
  color: var(--muted, #5c6670);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.tm-detail-close:hover { color: inherit; }
.tm-detail-meta { margin: 8px 0 8px; font-size: .8rem; font-weight: 600; color: var(--muted, #5c6670); }
.tm-stops-list {
  margin: 0;
  padding-left: 20px;
  font-size: .84rem;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tm-stop-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tm-stop-btn:hover { color: var(--accent, #1d6fd6); text-decoration: underline; }

.tm-article h2 { margin-top: 28px; margin-bottom: 12px; }
.tm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
  margin: 18px 0 24px;
}
.tm-stat {
  padding: 12px 14px;
  border: 1px solid var(--line, #e2e6ea);
  border-left: 4px solid var(--tm-type, var(--accent, #1d6fd6));
  border-radius: 8px;
  background: var(--card, #fff);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tm-stat strong { font-size: 1.35rem; line-height: 1.1; }
.tm-stat span { font-size: .86rem; color: var(--muted, #5c6670); }

.tm-group { margin-bottom: 18px; }
.tm-group h3 { margin: 0 0 10px; font-size: 1.05rem; }
.tm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-chip {
  padding: 5px 10px;
  border: 1px solid var(--line, #d7dde3);
  border-left: 3px solid var(--tm-type, #1d6fd6);
  border-radius: 6px;
  background: var(--card, #fff);
  color: inherit;
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.tm-chip:hover {
  background: var(--bg, #f4f6f8);
  border-color: var(--tm-type, #1d6fd6);
}

.tm-faq { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.tm-faq-item {
  padding: 14px 16px;
  border: 1px solid var(--line, #e2e6ea);
  border-radius: 10px;
  background: var(--card, #fff);
}
.tm-faq-item h3 { margin: 0 0 6px; font-size: 1.02rem; line-height: 1.35; }
.tm-faq-item p { margin: 0; font-size: .95rem; line-height: 1.55; }
.tm-faq-link {
  margin-top: 8px;
  padding: 5px 10px;
  border: 1px solid var(--line, #d7dde3);
  border-radius: 6px;
  background: var(--bg, #f7f8fa);
  color: var(--accent, #1d6fd6);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
}
.tm-faq-link:hover { border-color: var(--accent, #1d6fd6); background: #fff; }

@media (max-width: 900px) {
  .tm-grid { grid-template-columns: 1fr; }
  .tm-map-wrap, .tm-map { min-height: 360px; height: 360px; }
  .tm-sidebar { border-left: 0; border-top: 1px solid var(--line, #e2e6ea); max-height: 420px; }
}
@media (max-width: 480px) {
  .tm-toolbar { padding: 10px; }
  .tm-search-wrap { max-width: none; flex-basis: 100%; }
  .tm-map-wrap, .tm-map { min-height: 310px; height: 310px; }
  .tm-active-bar { flex-direction: column; align-items: stretch; gap: 6px; }
}
