html, body { height: 100%; }
#wpgtfsp-app.wpgtfsp-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background: #f5f7fa;
  font-size: 14px;
}
.wpgtfsp-sidebar {
  width: 420px;
  max-width: 100%;
  background: #fff;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.wpgtfsp-header, .wpgtfsp-form, .wpgtfsp-results { padding: 18px; }
.wpgtfsp-header h2, .wpgtfsp-results h3 { margin: 0 0 8px; }
.wpgtfsp-form { padding: 18px; }
.wpgtfsp-form.is-hidden {
  display: none;
}
.wpgtfsp-form label { display:block; font-weight: 600; margin: 10px 0 6px; }
.wpgtfsp-form input, .wpgtfsp-form button {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; border: 1px solid #cfd7df;
}
.wpgtfsp-form button { margin-top: 14px; background: #111827; color: #fff; cursor: pointer; }
.wpgtfsp-row { display:flex; gap: 10px; }
.wpgtfsp-row > div { flex:1; }
.wpgtfsp-suggest { margin-top: 4px; border-radius: 10px; overflow: hidden; }
.wpgtfsp-suggest button { text-align:left; border-radius:0; background:#fff; color:#111; border:1px solid #eee; border-top:none; }
.wpgtfsp-map-wrap { flex: 1; min-height: 100vh; position: relative; }
#wpgtfsp-map { width: 100%; min-height: 100vh; }
.wpgtfsp-card {
  border:1px solid #e5e7eb; border-radius: 14px; background:#fff; padding: 12px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
  cursor: pointer;
}
.wpgtfsp-card strong { display:block; margin-bottom:6px; }
.wpgtfsp-badge { display:inline-block; padding:2px 8px; border-radius: 999px; background:#eef2ff; font-size:12px; margin-right:6px; }
.wpgtfsp-results {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid #eef2f7;
}
.wpgtfsp-results.is-hidden {
  display: none;
}
.wpgtfsp-detail-panel {
  padding: 18px;
  border-top: 1px solid #eef2f7;
  background: #fff;
  overflow-y: auto;
}
.wpgtfsp-detail-panel.is-hidden {
  display: none;
}
.wpgtfsp-detail-back {
  border: 0;
  background: transparent;
  color: #0f172a;
  font-weight: 700;
  font-size: 14px;
  padding: 0;
  margin: 0 0 12px;
  cursor: pointer;
}
.wpgtfsp-detail-title {
  margin: 0 0 10px;
  font-size: 18px;
}
.wpgtfsp-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  font-size: 14px;
}
.wpgtfsp-detail-meta {
  margin-top: 10px;
  color: #334155;
  font-size: 13px;
}
.wpgtfsp-status-card {
  margin-top: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wpgtfsp-status-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 2px;
}
.wpgtfsp-status-main {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}
.wpgtfsp-status-sub {
  font-size: 12px;
  color: #334155;
  margin-top: 2px;
}
.wpgtfsp-status-light {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .15);
}
.wpgtfsp-stops-list {
  margin-top: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.wpgtfsp-stop-head {
  display: grid;
  grid-template-columns: 16px 1fr 64px 64px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.wpgtfsp-stop-row {
  display: grid;
  grid-template-columns: 16px 1fr 64px 64px;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-bottom: 1px solid #eef2f7;
  font-size: 13px;
}
.wpgtfsp-stop-row:last-child {
  border-bottom: 0;
}
.wpgtfsp-stop-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
  justify-self: center;
}
.wpgtfsp-stop-row.is-passed .wpgtfsp-stop-dot {
  background: #2563eb;
}
.wpgtfsp-stop-row.is-current .wpgtfsp-stop-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .2);
}
.wpgtfsp-stop-name {
  color: #1e293b;
  font-weight: 600;
}
.wpgtfsp-delay-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e0ecff;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}
.wpgtfsp-stop-time {
  color: #334155;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.wpgtfsp-stop-rt {
  color: #0f766e;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.wpgtfsp-status-card--compact {
  display: block;
}
.wpgtfsp-status-card--compact .wpgtfsp-detail-row {
  margin: 4px 0;
}
.wpgtfsp-status-card--compact .wpgtfsp-detail-row span {
  color: #334155;
}
.wpgtfsp-status-card--compact .wpgtfsp-detail-row strong {
  font-size: 12px;
}
@media (max-width: 900px) {
  #wpgtfsp-app.wpgtfsp-layout { flex-direction: column; }
  .wpgtfsp-sidebar { width: 100%; }
  .wpgtfsp-map-wrap, #wpgtfsp-map { min-height: 60vh; }
}

.wpgtfsp-input-wrap { position: relative; }
.wpgtfsp-suggest {
  position: relative;
  display: none;
  margin-top: 4px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
  max-height: 260px;
  overflow-y: auto;
}
.wpgtfsp-suggest-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
}
.wpgtfsp-suggest-item:last-child { border-bottom: 0; }
.wpgtfsp-suggest-item:hover,
.wpgtfsp-suggest-item.is-active { background: #f3f7ff; }
.wpgtfsp-suggest-title {
  display: block;
  font-weight: 600;
  color: #111827;
  text-align: left;
}
.wpgtfsp-suggest-meta {
  display: block;
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}
.wpgtfsp-bus-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.wpgtfsp-bus-icon-glyph {
  width: 12px;
  height: 8px;
  border-radius: 2px;
  border: 2px solid #fff;
  position: relative;
  box-sizing: border-box;
}
.wpgtfsp-bus-icon-glyph::before,
.wpgtfsp-bus-icon-glyph::after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 999px;
}
.wpgtfsp-bus-icon-glyph::before {
  left: -2px;
}
.wpgtfsp-bus-icon-glyph::after {
  right: -2px;
}
.wpgtfsp-stop-poi {
  background: transparent;
}
.wpgtfsp-stop-poi-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #1d4ed8;
  box-sizing: border-box;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.wpgtfsp-stop-poi.is-terminal .wpgtfsp-stop-poi-dot {
  width: 16px;
  height: 16px;
  border-color: #f97316;
  border-width: 3px;
}
